how to array is not in js 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")