Javascript examples for Array:length Property
Create empty array and check its length
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*from www . j a va2 s. c o m*/ var myArray = []; if (myArray.length == 0) { myArray = ["2", "test4", "6", "8", "10", "100", "20", "Bingo!"]; } console.log(myArray.length) } </script> </head> <body> </body> </html>