1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/traverse/examples/negative.js

11 lines
206 B
JavaScript
Raw Normal View History

2024-01-16 21:26:16 +08:00
'use strict';
2023-12-18 13:12:25 +08:00
var traverse = require('traverse');
2024-01-16 21:26:16 +08:00
var obj = [5, 6, -3, [7, 8, -2, 1], { f: 10, g: -13 }];
2023-12-18 13:12:25 +08:00
traverse(obj).forEach(function (x) {
2024-01-16 21:26:16 +08:00
if (x < 0) { this.update(x + 128); }
2023-12-18 13:12:25 +08:00
});
console.dir(obj);