Javascript examples for Language Basics:Introduction
JavaScript arrays work like arrays in most other programming languages.
Creating and Populating an Array
<!DOCTYPE HTML> <html> <head> <title>Example</title> </head> <body> <script type="text/javascript"> var myArray = new Array(); myArray[0] = 100;//from www .j a v a2s .c o m myArray[1] = "java2s.com"; myArray[2] = true; </script> </body> </html>