Does Dojo have a method similar to jQuery’s each() that allows you to pass an object to iterate over? jQuery.each() allows you to pass either an array or an object. In the latter case, the callback function receives both a key and the value. Is there something that allows you to do this in Dojo?
Does Dojo have a method similar to jQuery’s each() that allows you to pass
Share
Looks like you are looking for
dojox.lang.functional.object.forIn.There’s no actual documentation page in dojo reference, only a small example in article Functional fun in JavaScript with Dojo:
If you have something against using that module you can also easily make your own variant:
For arrays there is already dojo.forEach() in the base library.