Answers for "how to check is value exists in array"

5

javascript method to see if item exists in array

var fruits = ["Apple", "Banana", "Mango", "Orange", "Papaya"];
    
    // Check if a value exists in the fruits array
    if(fruits.indexOf("Mango") !== -1){
        alert("Value exists!")
    } else{
        alert("Value does not exists!")
    }
Posted by: Guest on April-16-2020
0

how to check is value exists in array

564
  564
  231
Posted by: Guest on January-06-2021

Code answers related to "how to check is value exists in array"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language