Use the continue statement to not output the array's element "CSS". - Javascript Statement

Javascript examples for Statement:Quiz

Description

Use the continue statement to not output the array's element "CSS".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

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

<script>
var myArray = ["Javascript", "HTML", "CSS", "Ford"];
var text = ""
var i;//from  ww w .  j  a va 2s  .c o m
for (i = 0; i < myArray.length; i++) {
    if (myArray[i] === "CSS")
       continue;
    text += myArray[i] + "<br>";
}
document.getElementById("demo").innerHTML = text;
</script>

</body>
</html>

Related Tutorials