Onbekend |
|
Oké, opgelost dus.
De oplossing (voor degenen die het willen weten):
function in_array(needle, haystack) {
for (h in haystack) {
if (haystack[h] == needle) {
return true;
}
}
return false;
}
arr = Array("001","value2","value3");
if(in_array('001', arr)) {
alert('bestaat!');
}
for (h in haystack) { if (haystack[h] == needle) { return true; } } return false; } arr = Array("001","value2","value3"); alert('bestaat!'); }
Grz,
Rick. |