Sha256: 9c5c0f0eb96aca73a6855f5cb3ab5965b1c9d81dd02fb1a92c537a6e80a57b19
Contents?: true
Size: 260 Bytes
Versions: 69
Compression:
Stored size: 260 Bytes
Contents
var Traverse = require('traverse'); var obj = { a : [1,2,3], b : 4, c : [5,6], d : { e : [7,8], f : 9 }, }; var leaves = Traverse(obj).reduce(function (acc, x) { if (this.isLeaf) acc.push(x); return acc; }, []); console.dir(leaves);
Version data entries
69 entries across 69 versions & 2 rubygems