I need to know how I can search an array for some literal text and have it used as a condition whether to continue.
Heres why: Each time I execute a function I am pushing the ID of the property it acts upon into an array. I need my funtion to check if that ID is in the array already and if it is, remove it and execute my other function (the opposite).
Heres an example array:
var myArray = new Array();
myArray.push([1.000,1.000,"test1"]);
myArray.push([2.000,2.000,"test2"]);
myArray.push([3.000,3.000,"test3"]);
I know the Grep function can search but I can't get it to evaluate true or false if it finds something.
Heres my ideal use of the search evaluation.
function searcher(id){
if(myArray.grep(id);){
oppositeFunction(id);
}else{
function(id);
}
}