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 1 year ago