1.1.1 • Published 4 years ago

arraylikeobj v1.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

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 / MethodDescriptionReturnsIs iterable
lengthThe length of the object.numberfalse
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.stringfalse

Inspired by Ecma.