Realated Questions
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++; }
The unordered collection of properties, each of which has a name and a value is called