Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What happens in the following javaScript code snippet?
var count = 0;
while (count < 10)
{
console.log(count);
count++;
}

What happens in the following javaScript code snippet?
var count = 0;
while (count < 10)
{
console.log(count);
count++;
}
a) The values of count are logged or stored in a particular location or storage
b) The value of count from 0 to 9 is displayed in the console
c) An error is displayed
d) An exception is thrown

Answer: b
Explanation: Console.log is a predefined function in JavaScript which takes the value as an argument of its function.console.log prints this value in the argument in the console at the time of execution of the code.

Join The Discussion