source:
node_modules/traverse/examples/negative.js
Last change on this file was d24f17c, checked in by , 15 months ago | |
---|---|
|
|
File size: 206 bytes |
Rev | Line | |
---|---|---|
[d24f17c] | 1 | 'use strict'; |
2 | ||
3 | var traverse = require('traverse'); | |
4 | var obj = [5, 6, -3, [7, 8, -2, 1], { f: 10, g: -13 }]; | |
5 | ||
6 | traverse(obj).forEach(function (x) { | |
7 | if (x < 0) { this.update(x + 128); } | |
8 | }); | |
9 | ||
10 | console.dir(obj); |
Note:
See TracBrowser
for help on using the repository browser.