To check if a value for an array has been set or not you should check if the element equals null:
<script>
var arrValues = new Array(7);
alert(arrValues[2]==null);
alert(arrValues[200]==null);
//checking an element at 200 does not change the array's length
alert(arrValues.length);
arrValues[200]="hello";
alert(arrValues.length);
alert(arrValues[200]==null);
</script>
To remove an element you can set it to null allthough this will not change the length of an Array in javascript.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.