source:
node_modules/json-stable-stringify/example/value_cmp.js@
d24f17c
Last change on this file since d24f17c was d24f17c, checked in by , 15 months ago | |
---|---|
|
|
File size: 210 bytes |
Line | |
---|---|
1 | 'use strict'; |
2 | |
3 | var stringify = require('../'); |
4 | |
5 | var obj = { d: 6, c: 5, b: [{ z: 3, y: 2, x: 1 }, 9], a: 10 }; |
6 | |
7 | var s = stringify(obj, function (a, b) { |
8 | return a.value < b.value ? 1 : -1; |
9 | }); |
10 | |
11 | console.log(s); |
Note:
See TracBrowser
for help on using the repository browser.