JavaScript Loops: for…in vs for

Don’t use for..in for Array iteration. It’s important to understand that Javascript Array’s square bracket syntax ([]) for accessing indicies is actually inherited from the Object… obj.prop === obj[‘prop’] // true The for..in structure does not work like a more traditional for..each/in that would be found in other languages (php, python, etc…). Javascript’s for..in is … Read more