@grabenair:
Not quite true -- a for loop has an automatic break built in. In the code above, it should break after i is no longer less than products.length. (We're also dealing with Javascript here, not PHP.)
@Ed4Words:
When I run that code (and assuming I click on the header, obviously), the system prints out the four array items, then stops. As far as I can tell, it's working correctly. What is happening that makes you think the code is still running?