set-or-get.js:设置或获取对象字段值

时间:2021-05-24 20:25:23
【文件属性】:
文件名称:set-or-get.js:设置或获取对象字段值
文件大小:7KB
文件格式:ZIP
更新时间:2021-05-24 20:25:23
hacktoberfest JavaScript 设置或获取 设置或获取对象字段值。 :cloud: 安装 # Using npm npm install --save set-or-get # Using yarn yarn add set-or-get :clipboard: 例子 // Dependencies var SetOrGet = require ( "set-or-get" ) ; // Create an object var cache = { } ; SetOrGet ( cache , "foo" , [ ] ) . push ( 42 ) ; // { foo: [42] } SetOrGet ( cache , "bar" , { } ) . baz = 42 ; // { foo: [42], bar: { baz: 42 } } SetOrGet ( cache , "foo" , [ ] ) . push ( 7 ) ;
【文件预览】:
set-or-get.js-master
----.gitignore(80B)
----package.json(1KB)
----DOCUMENTATION.md(368B)
----CONTRIBUTING.md(3KB)
----LICENSE(1KB)
----README.md(5KB)
----example()
--------index.js(368B)
----lib()
--------index.js(621B)
----test()
--------index.js(410B)

网友评论