test if a variable is an array or a string js code example Example: if object is array javascript Array.isArray(object);