Javascript examples for Array:constructor
Re-filling an array when it is null
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from w ww . j ava 2 s . co m*/ var myArray = []; if (myArray.length == 0) { myArray = ["2", "4", "test6", "8", "10", "100", "20", "Bingo!"]; } console.log(myArray.length) } </script> </head> <body> </body> </html>