shreyaskudav Posted May 12, 2011 Share Posted May 12, 2011 For....InI really couldn't understand it?Can anyone please try to explain me with some examples...?And where is this function usually useful? Link to comment Share on other sites More sharing options...
birbal Posted May 12, 2011 Share Posted May 12, 2011 did you check this? http://w3schools.com/js/js_loop_for_in.asp Link to comment Share on other sites More sharing options...
jeffman Posted May 12, 2011 Share Posted May 12, 2011 for-loops have been central to computing for a long time. They let you apply the same task to many pieces of information without writing a lot of extra code your don't need. But they originally could be used only on arrays that are numerically indexed.Modern objects (true objects or associative arrays) are NOT numerically indexed. Object indexes are named like variables. A for-in loop lets you iterate over all the elements of an object without knowing their names. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.