Javascript examples for Language Basics:Introduction
The array literal style lets you create and populate an array in a single statement.
Using the Array Literal Style
<!DOCTYPE HTML> <html> <head> <title>Example</title> </head> <body> <script type="text/javascript"> var myArray = [100, "java2s.com", true]; </script> </body> </html>//from w w w . j a v a 2 s . co m