Thursday, May 22, 2014

JavaScript For Loops and its Cousins

What?! JavaScript doesn't have a for-each loop? You gotta be kidding me!

That was my reaction to my co-worker whose code I was peer-reviewing. I suggested him to use a for-each loop instead of a vanilla for. And he said - "I don't remember seeing a foreach loop in JavaScript?!"

JavaScript has some interesting variations to the for loops and I feel they are not really that popular. So in a bid to learn and understand them I wrote a post on CodeProject. I hope you find it helpful. 

No comments: