a) Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property
View Question
What will be the equivalent code of the following JavaScript code?
for(var p in o)
console.log(o[p]);
What will be the equivalent code of the following JavaScript code? for(var p in o) ...
View Question
What will the following JavaScript code snippet work? If not, what will be the error?
function tail(o)
{
for (; o.next; o = o.next) ;
return o;
}
What will the following JavaScript code snippet work? If not, what will be the error? function tail(o)
View QuestionWhat are the three important manipulations done in a for loop on a loop variable?
a) Updation, Incrementation, Initialization b) Initialization,Testing, Updation c) Testing, Updation, Testing d) Initialization,Testing, Incrementation Answer: b Explanation: In a ...
View Question
What will be the output of the following JavaScript code?
function printArray(a)
{
var len = a.length, i = 0;
if (len == 0)
console.log(“Empty Array”);
else
{
do
{
console.log(a[i]);
} while (++i < len);
}
}
What will be the output of the following JavaScript code? function printArray(a) { ...
View Question
What will be the output of the following JavaScript code?
var grade=’E’;
var result;
switch(grade)
{
case ‘A’:
result+=”10″;
case ‘B’:
result+=” 9″;
case ‘C’:
result+=” 8″;
default:
result+=” 0″;
}
document.write(result);
What will be the output of the following JavaScript code? var grade='E'; var result;
View Question
What will be the output of the following JavaScript code?
int a=4;
int b=1;
int c=0;
If(a==b)
document.write(a);
else if(a==c)
document.write(a);
else
document.write(c);
What will be the output of the following JavaScript code? int a=4; int b=1; int c=0; If(a==b) ...
View Question
What will be the output of the following JavaScript code?
var grade=’A’;
var result;
switch(grade)
{
case ‘A’:
result+=”10″;
case ‘B’:
result+=” 9″;
case ‘C’:
result+=” 8″;
default:
result+=” 0″;
}
document.write(result);
What will be the output of the following JavaScript code? var grade='A'; var result;
View Question
What will be the output of the following JavaScript code?
var grade=’B’;
var result;
switch(grade)
{
case ‘A’:
{
result+=”10″;
break;
}
case ‘B’:
{
result+=” 9″;
break;
}
case ‘C’:
{
result+=” 8″;
break;
}
default:
result+=” 0″;
}
document.write(result);
What will be the output of the following JavaScript code? var grade='B'; var result;
View Question
What will be the output of the following JavaScript code?
Int a=1;
if(a>10)
{
document.write(10);
}
else
{
document.write(a);
}
What will be the output of the following JavaScript code? Int a=1; if(a>10) { ...
View Question