traverse-deep
v0.0.1
Published
iterate array or object
Downloads
2
Readme
var iterate = require('../traverse-deep'); iterate({hello:'world'},function(value,index,obj) { console.log(value,index) },null)
iterate([1,2,3],function(value,index,obj) { console.log(value,index) },null)
iterate({hello:[1,2,3]},function(value,index,obj) { console.log(value,index) },null,false)
iterate({hello:[1,2,3]},function(value,index,obj) { console.log(value,index) },null,true)
iterate([1,2,[3],{a:4,b:5}],function(value,index,obj) { console.log(value,index) },null,false)
iterate([1,2,[3],{a:4,b:5}],function(value,index,obj) { console.log(value,index) },null,true)
iterate({hello:[{a:1},2,3]},function(value,index,obj) { console.log(value,index) },null,true)
iterate([1,2,3],function(value,index,obj) { console.log(value,index) if (value === 1) return false; },null,true) //if (a==10) return false