1.1.1 • Published 5 years ago
arraylikeobj v1.1.1
ArrayLike
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.