/  JavaScript-Quiz-2

This Quiz contains totally 10 Questions each carry 1 point for you.

1. What keyword is used to check whether a given property is valid or not?
in
is in
exists
lies

Correct!

Wrong!

2. What is the use of the <noscript> tag in Javascript?
The contents are displayed by non-JS-based browsers.
Clears all the cookies and cache.
Both 1 & 2
None of these

Correct!

Wrong!



3. What will be the output of the following code snippet?

(function(){
setTimeout(()=> console.log(1),2000);
console.log(2);
setTimeout(()=> console.log(3),0);
console.log(4);
})();


1 2 3 4
2 3 4 1
2 4 3 1
4 3 2 1

Correct!

Wrong!



4. What will be the output of the following code snippet?

(function(a){
return (function(){
console.log(a);
a = 6;
})()
})(21);


21
6
NaN
None of the above

Correct!

Wrong!



5.What will be the output of the following code snippet?

function solve(arr, rotations){
if(rotations == 0) return arr;
for(let i = 0; i < rotations; i++){
let element = arr.pop();
arr.unshift(element);
}
return arr;
}
// solve([44, 1, 22, 111], 5);


[111, 44, 1, 22]
[44, 1, 22, 111]
[1, 22, 111, 44]
[22, 111, 44, 1]

Correct!

Wrong!



6. What will be the output for the following code snippet?

<p id="example"></p>  
<script>
function Func()
{
document.getElementById("example").innerHTML=Math.sqrt(81);
}
</script>










 



9
81
0
error

Correct!

Wrong!

7. When an operator’s value is NULL, the typeof returned by the unary operator is:
Boolean
Undefined
Object
Integer

Correct!

Wrong!



8. What will be the output of the following code snippet?

var a = 1;  
var b = 0;
while (a <= 3)
{
a++;
b += a * 2;
print(b);
}


4 10 18
1 2 3
1 4 7
None of these

Correct!

Wrong!

9. What does the Javascript “debugger” statement do?
It will debug all the errors in the program at runtime.
It acts as a breakpoint in a program.
It will debug error in the current statement if any.
All the above

Correct!

Wrong!



10. What will be the output of the following code snippet?

var a = Math.max();
var b = Math.min();
print(a);
print(b);


-Infinity Infinity
Infinity -Infinity
-Infinity -Infinity
Infinity Infinity

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

Ignore & go to results

JavaScript-Quiz-2

You got %%score%% of %%total%% right

%%description%%

%%description%%

Where to go ?

Quizzes

Loading...