0
Without using typeof, how can you check if a variable is an array?
subina kallyani
easy
3completed
71
Answer
Array.isArray(variable);This returns true if the variable is an array, and false otherwise.
let arr = [1, 2, 3];
console.log(Array.isArray(arr)); // trueClick to Reveal Answer
Tap anywhere to see the solution
Revealed
Comments0