if type is array javascript code example Example: js check if is array if(Array.isArray(colors)){ //colors is an array }