Array Literal - Javascript Language Basics

Javascript examples for Language Basics:Introduction

Introduction

The array literal style lets you create and populate an array in a single statement.

Using the Array Literal Style

Demo Code

ResultView the demo in separate window

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

Related Tutorials