JS โฉ object โฉ built-in โฉ Array โฉ array-like
objects that have indexes and length.
array-likes๏ผ
touchEvent.touches (TouchList)
the "arguments" object
String
array-like and iterable are different things.
let arrayLike = { 0: "Hello", // has indexes 1: "World", length: 2, // has length }
๐พ replit๏ผstring is array-like
// โญ๏ธ string is array-like const str = 'abc'; str.length, // 3 (string has length) str[0], // 'a' (string has numeric indexes)
JS.info โฉ iterables
Array.from() - convert iterable/array-like to Array.
Last updated 2 years ago
Was this helpful?