clone-json
install
# Install with npm$ npm install clone-json --save# Install with yarn$ yarn add clone-json
Usage
Two arrays are equal
let cloneJson = let json = a: 123 b: 'str' c: true d: 1 '2' false e: 3 f: g: 789 h: 'str' i: true j: 2 let newJson = newJsona = 456newJsonb = 'string'newJsonc = falsenewJsond0 = 2newJsond1 = '3'newJsond2 = truenewJsond3e = 4newJsonfg = 987newJsonfh = 'string'newJsonfi = falsenewJsonfj0 = 3 console // => No changes have taken place/* result: { a: 123, b: 'str', c: true, d: [1, '2', false, { e: 3 }], f: { g: 789, h: 'str', i: true, j: [2] }}*/ console/* result:{ a: 456, b: 'string', c: false, d: [2, '3', true, { e: 4 }], f: { g: 987, h: 'string', i: false, j: [3] }}
Contributing
Commits | Contributor |
---|---|
5 | Black-Hole |
Author
Black-Hole
- Email:158blackhole@gmail.com
- Blog:http://bugs.cc
- WeiBo:http://weibo.com/comelove
- Twitter:https://twitter.com/Free_BlackHole