The U.S. Department of Energy states categorically that “Aggressive driving (speeding, rapid acceleration and braking) wastes gas. It can lower your gas mileage by 33 percent at highway speeds and by 5 percent around town.” Slamming on your brakes, unless reacting to an emergency, is a strong indication that you are driving over-aggressively.
Aggressive driving is bad for you and other road users -- it invariably raises stress levels and makes everybody tense and adversarial -- as well as for your vehicle. The habit of slamming on brakes is commonly accompanied by full-throttle acceleration, which is the primary non-mechanical cause of wasted gas. Further, loss of momentum translates directly into an increased fuel burn to regain the original speed; if this is unnecessary, it should be avoided.