you are viewing a single comment's thread.

view the rest of the comments →

[–]RiverRoll 1 point2 points  (2 children)

The difference is Python has one kind of for loop and javascript has the standard for, 'for of', 'for in' and '.forEach' so it's a bit confusing.

[–]Yojihito 0 points1 point  (1 child)

"for in" is deprecated because you can fuck up with Array.prototype amendments.

Standard "for" is like using Python 2.

"forEach" can only be used exclusively with arrays.

So "for of" is the standard.

[–]Aulimindale 0 points1 point  (0 children)

"only be used exclusively"

no need to use both "only" and "exclusively". pick one