#learning #javascript #homework I never bothered learning JavaScript, and now I'm correcting that error. These are my notes as I start from square one.
Arrays give us the ability to hold multiple values in a single variable. Arrays can hold any data type.
<html>
<head>
<title>Javascript Arrays</title>
</head>
<body>
<h1>Javascript Arrays</h1>
<p>Arrays give us the ability to hold multiple values in a single variable. Arrays can hold any data type.</p>
<script>
// literal array
var myArray = ["string",100,false];
var myArray3 = [];
// Array constructor
var myArray1= new Array("string",100,false);
var myArray2 = new Array();
document.write( 'myArray =' + myArray + '<br>');
document.write( 'myArray[0] = ' + myArray[0] + '<br>' );
document.write( 'myArray[1] = ' + myArray[1] + '<br>' );
document.write( 'myArray[2] = ' + myArray[2] + '<br>' );
document.write( 'myArray[1] = "New Value";<br>' );
myArray[1] = "New Value";
document.write( 'myArray =' + myArray);
</script>
</body>
</html>