...
Solution Review: Array or Not?
This lesson will explain the solution to the problem in the previous lesson.
function check(obj) { if (Object.prototype.toString.call(obj) === "[object Array]") { return true; } else { return false; }}console.log(check(123));console.log(check("cat"));console.log(check([1, 2, 3, 4]));
To check whether the passed in object ...