array-envelop:将类似数组的对象包装到数组

时间:2021-04-27 19:44:59
【文件属性】:
文件名称:array-envelop:将类似数组的对象包装到数组
文件大小:13KB
文件格式:ZIP
更新时间:2021-04-27 19:44:59
JavaScript 数组包络 这样可以将类似数组的对象包装到数组,以便可以使用每种数组方法。 通过尝试一下。 import { envelop } from "array-envelop" ; const object = { 0 : "maya" , 1 : "eve" , length : 2 } ; const enveloped = envelop ( object ) ; enveloped . indexOf ( "eve" ) ; // returns 1 /* * Anything that mutates the array will throw, including the followings: * * enveloped.length = "peanut"; * enveloped.push("peanut"); * enveloped.pop(); * e
【文件预览】:
array-envelop-master
----.travis.yml(36B)
----index.js(149B)
----package.json(702B)
----test()
--------test.js(3KB)
----LICENSE(755B)
----package-lock.json(22KB)
----.npmignore(6B)
----main.js(1KB)
----.gitignore(5KB)
----README.md(1KB)
----.gitattributes(66B)

网友评论