Last updated 2 years ago
Was this helpful?
⟩ ⟩ ⟩ ⟩ array-like
objects that have indexes and length.
array-likes:
touchEvent. ()
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 const str = 'abc'; str.length, // 3 (string has length) str[0], // 'a' (string has numeric indexes)
JS.info ⟩
- convert iterable/array-like to Array.