Last Updated: September 23, 2016
·
15.39K
· fr0gs

Check if object is Array in javascript (ES6/Typescript)

let isArray = (data) => {
  return (Object.prototype.toString.call(data) === "[object Array]");  
}

2 Responses
Add your response

whats the advantage over Array.isArray()?

over 1 year ago ·

I did not know about that method when I wrote this, so I'd say that virtually none :P.

over 1 year ago ·