Rewrite for…each with for…of				#68
		
		
	
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	
	No description provided.
		
		Delete branch "rewrite-for-each-with-for-of"
	
	Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
 
		
Rhino’s
for…eachloop is a non-standard JavaScript extension and causing some problems, e.g. with JSDoc.Rewriting it is quite straight-forward, either by using the
for…ofloop, theArray.forEach()method, or the good oldfor…insyntax: