how to check if a variable is an array or an object in javascript code example Example: if object is array javascript Array.isArray(object);