|
Subject:
|
check if an array element is not undefined
|
|
Posted By:
|
crmpicco
|
Post Date:
|
10/6/2005 5:17:30 AM
|
if (typeof(seatArr[s-1]) != "undefined")
{
el.innerHTML = el.innerHTML + seatArr[s-1];
}
will this work to check if an array element is not undefined?
www.crmpicco.co.uk
|
|
Reply By:
|
ChrisScott
|
Reply Date:
|
10/6/2005 11:40:58 AM
|
You can just compare the array element to undefined...
var myArr = [];
alert(myArr[5] == undefined);
HTH,
Chris
|