Arrays - Javascript Language Basics

Javascript examples for Language Basics:Introduction

Introduction

JavaScript arrays work like arrays in most other programming languages.

Creating and Populating an Array

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials