Crew PHP |
|
dit?
////////// Javascript heeft geen In_Array(), even aanmaken
function in_array (needle, haystack, argStrict) {
var key = '', strict = !!argStrict;
if (strict) {
for (key in haystack) {
if (haystack[key] === needle) {
return true; }
}
} else {
for (key in haystack) {
if (haystack[key] == needle) { return true;
}
}
}
return false;
}
////////// einde In_Array()
var onthoud = array();
var i = 1;
while (i !== 1000){
if( i % 2 === 0 ){ onthoud[] = i/2; }
else{ onthoud[] = (i*3)+1;}
i++;
}
if(in_array(1,onthoud)){alert("jup");}
////////// Javascript heeft geen In_Array(), even aanmaken function in_array (needle, haystack, argStrict) { var key = '', strict = !!argStrict; if (strict) { for (key in haystack) { if (haystack[key] === needle) { return true; } } } else { for (key in haystack) { if (haystack[key] == needle) { return true; } } } return false; } ////////// einde In_Array() var onthoud = array(); var i = 1; while (i !== 1000){ if( i % 2 === 0 ){ onthoud[] = i/2; } else{ onthoud[] = (i*3)+1;} i++; } if(in_array(1,onthoud)){alert("jup");}
|