Array.isArrayadvancedArray.isArray(Array.from('abc')) // β true (converted to real array)
Array.isArray({0:'a', length:1}) // β false (array-like, not array)Use Array.isArray() to distinguish real arrays from array-like objects such as NodeList or arguments.
An array-like object has a numeric length property (e.g. { length: 2 }, arguments, NodeList) but is not a real array. Array.isArray returns false for them.
Challenge: Implement getType that classifies a value as:
'array' β a real array'array-like' β a non-array object with a numeric length property'other' β anything elsegetType([1, 2]) // β 'array'
getType({ length: 2}) // β 'array-like'
getType('hello') // β 'other'