npm.io
1.1.1 • Published 6 years ago

arraylikeobj

Licence
MIT
Version
1.1.1
Deps
1
Size
5 kB
Vulns
0
Weekly
0

ArrayLike

NPM Version NPM Downloads

Similar to a normal array, but without the functions.

const ArrayLike = require("arraylikeobj");
const arraylike1 = new ArrayLike("Hello", "World");

for (const element of arraylike1) {
    console.log(element); /* Expected output: Hello
                                              World */
}
Property / Method Description Returns Is iterable
length The length of the object. number false
entries() An array of the keys and values of the object. [number, type] (for every entry) true
keys() The keys of the object. number (for every entry) true
values() The values of the object. type (for every entry) true
toString(separator?: string) A string representation of the object, with the values joined by the separator. string false

Inspired by Ecma.

Keywords