How to recognize array & object in js where typeof doesn’t come in handy?
var arr = [], ob = {};
As everything in js are objects,
You could use Array.isArray() method to check if a variable is array or otherwise.
var myArray = [1,2,3,4,5]; console.log(Array.isArray(myArray));
true