array not in javascript code example Example 1: in javascript check is is an array or not Array.isArray(yourItem) Example 2: not in array js !array.includes("element")