L
Q. Among the following given JavaScript snipped codes, which is more efficient
Code 1 for(var number=10;number>=1;number--) { document.writeln(number); } Code 2: var number=10; while(number>=1) { document.writeln(number); number++; }
Code 1 will be more efficient. In fact, the second code may encounter a runtime error because the value of "number" is never going to be equal to or less than one.
You must be Logged in to update hint/solution
Be the first to start discuss.
Q. What is the role of the "continue" keyword in the following piece of JavaScript code?
Q. What is the significance of the JavaScript logging library log4javascript?
Q. Why does the Node rely on event handlers?
Q. Which keyword is used to define a JavaScript function?
Q. What is the command to run the node programs?
Q. What are the types of Pop up boxes available in JavaScript?
Q. Which of the following Attribute is used to include External JS code inside your HTML Document
Q. The ________ operator is used to create an instance of an object.
Q. The linkage of a set of prototype objects is known as______
Discusssion
Login to discuss.