ufeiya
Last Updated: September 23, 2016
·
8.394K
· 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

28112

whats the advantage over Array.isArray()?

over 1 year ago ·
28179

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

over 1 year ago ·