Change the first item of myArray to "SVG" by referring to the index number, and display the whole array. - Javascript Array

Javascript examples for Array:Quiz

Description

Change the first item of myArray to "SVG" by referring to the index number, and display the whole array.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<p id="demo"></p>

<script>
var myArray = ["CSS", "HTML", "Javascript"];
myArray[0] = "SVG";
document.getElementById("demo").innerHTML = myArray;
</script>/*from   w  ww  .ja va  2  s  .  c  o  m*/

</body>
</html>

Related Tutorials