how to check if item in array javascript code example
Example 1: js test if array
if(Array.isArray(myVarToTest)) {
// myVatToTest is an array
} else {
// myVarToTest is not an array
}
Example 2: how to check if item is in list js
var myList=["a", "b", "c"];
mylist.includes("d")//returns true or false