Chapter 5Simplify Loops

My auto mechanics teacher in high school once started off class by holding up a large adjustable wrench. “Some people think this is the only tool they need,” he said. He demonstrated how someone could use the wrench to unscrew a bolt, take off a screw, and pry off a gasket like a set of pliers. “They even use it as a hammer,” he said as he swung the wrench in the air.

“But if all you use is a wrench, you’ll round off your bolts. You’ll snap off fan blades, dent your car, and generally make things worse.” As he finished, he placed the wrench on the bench. “And that’s why we have specialized tools,” he said as he showed us how to use ratchet wrenches, torque wrenches, spark plug gap gauges, and all ...

Get Simplifying JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.