Array.isArraybeginnerArray.isArray([1, 2, 3]) // β true
Array.isArray('hello') // β false
Array.isArray({length: 3}) // β falseUse Array.isArray() to reliably check whether a value is an array.
Array.isArray(value) returns true if and only if the value is an Array object. It is the most reliable way to check for arrays β more reliable than instanceof Array when working across iframes or with subclasses.
Challenge: Implement isItAnArray that returns true when the value is an array and false otherwise.
isItAnArray([1, 2, 3]) // β true
isItAnArray('hello') // β false
isItAnArray({}) // β false