Javascript examples for Language Basics:Introduction
You read the value at a given index using square braces and ].
JavaScript uses zero-based array indexes.
Reading Data from an Array Index
<!DOCTYPE HTML> <html> <head> <title>Example</title> </head> <body> <script type="text/javascript"> var myArray = [100, "java2s.com", true]; document.writeln("Index 0: " + myArray[0]); </script> </body> </html>/*from w ww .j av a2 s .c o m*/