Append element to the end of an Array by reference the Array.length property : Array Length « Array « JavaScript Tutorial






<html>
<head>
<title>Append element to the end of an Array</title>

<script language="javascript" type="text/javascript">
<!--

var x = new Array(2,3,4);
x[x.length] = 1;
alert(x);

//-->
</script>

</head>
<body>

</body>
</html>








11.4.Array Length
11.4.1.Array.length
11.4.2.Get Array length
11.4.3.Remove elements from array by changing the array length
11.4.4.Append element to the end of an Array by reference the Array.length property
11.4.5.Get the last element in an Array
11.4.6.Length Automatically Updates