【文件属性】:
文件名称:clone-json:深度复制json
文件大小:13KB
文件格式:ZIP
更新时间:2021-05-18 17:46:07
JavaScript
克隆json
安装
# Install with npm
$ npm install clone-json --save
# Install with yarn
$ yarn add clone-json
用法
两个数组相等
let cloneJson = require ( 'clone-json' )
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 = cloneJson ( json )
newJson . a = 456
newJson . b = 'string'
【文件预览】:
clone-json-master
----.gitignore(884B)
----package.json(950B)
----package-lock.json(35KB)
----.travis.yml(200B)
----LICENSE(1KB)
----index.js(1KB)
----test.js(1KB)
----README.md(2KB)