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