Answers for "find word in array"

0

find word in array

var example_array = ['Rahul','Rajesh','Sonu','Siddhi','Mark','George'];  
  
function checkArray(value,array)  
{  
  var status = 'Absent';  
  
  for(var i=0; i<array.length; i++)  
{  
    var name = array[i];  
    if(name == value){  
      status = 'Present';  
      break;  
    }  
  }  
  return status;  
}  
Posted by: elena Trajkovska on May-11-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language