Skip to main content

Check if an object is an array

JavaScript version

const isArray = (obj) => Array.isArray(obj);

TypeScript version

const isArray = (obj: any): boolean => Array.isArray(obj);

Comments