Modifying the Contents of an Array - Javascript Language Basics

Javascript examples for Language Basics:Introduction

Description

Modifying the Contents of 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 = [100, "java2s.com", true];
          myArray[0] = "Tuesday";
          document.writeln("Index 0: " + myArray[0]);
       </script>
    </body>
</html>//w  w  w  . j  a v a2 s  . c  o  m

Related Tutorials