What is the meaning of : for (var key in object)?


#1



#2

A for loop consits of an instant variable, the object being manipulated, and the main body. So when you say,

 for (var key in object) {

}

var key - is the instant variable
in - refers
object - is the main object which could be a an array or a dictionary.
{

} - nests the contents of the body of the for loop.

So, yea that's pretty much it. :grin:


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.