Correct Answer : B
Realated Questions
Which of the following is the correct syntax to redirect a url using JavaScript?
Predict the output of the following JavaScript code.
var a="javascript"; var x=a.lastIndexOf("a"); document.write(x);
Which is a more efficient code snippet ?
Code 1 :for(var num=10;num>=1;num–) { document.writeln(num); }
Code 2 :
var num=10; while(num>=1) { document.writeln(num); num++; }