A

Admin • 828.03K Points
Coach

Q. Can we create empty array in Javascript? Find the output of below code

Code:
<script>

var firstNames = []; //creating empty array

for (var i = 0; i <=firstNames.length; i++) {
document.write("Javascript");
}

</script>
  • (A) Error
  • (B) Nothing is printed
  • (C) Javascript
  • (D) JavascriptJavascript
  • Correct Answer - Option(C)
  • Views: 15
  • Filed under category JavaScript
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.