Mega Code Archive

 
Categories / JavaScript Tutorial / Array
 

Append element to the end of an Array by reference the Array length property

< 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>