This Quiz contains totally 10 Questions each carry 1 point for you.
1. What will be the output of the following code snippet?
print(parseInt("123Hello"));
print(parseInt("Hello123"));
123 NaN
123Hello Hello123
123 123
NaN NaN
Correct!
Wrong!
2. Which of the following are closures in Javascript?
Variables
Functions
Objects
All of the above
Correct!
Wrong!
3. Which of the following is not a Javascript framework?
Cassandra
React
vue
node
Correct!
Wrong!
4. What will be the output of the following code snippet?
var a = "hello";
var sum = 0;
for(var i = 0; i < a.length; i++) {
sum += (a[i] - 'a');
}
print(sum);
47
0
NaN
None of the above
Correct!
Wrong!
5. What keyword is used to declare an asynchronous function in Javascript?
async
await
setTimeout
None of the above
Correct!
Wrong!
6. How to stop an interval timer in Javascript?
clearInterval
clearTimer
intervalOver
None of the above
Correct!
Wrong!
7. What will be the output of the following code snippet?
const set = new Set();
set.add(5);
set.add('Hello');
set.add({ name: 'Scaler' });
for (let item of set) {
console.log(item + 6);
}
11 NaN NaN
11 NaN [object Object]
11 Hello6 [object Object]6
None of the above
Correct!
Wrong!
8. How are objects compared when they are checked with the strict equality operator?
The contents of the objects are compared
Their references are compared
Both A and B
None of the above
Correct!
Wrong!
9. What does … operator do in JS?
It is used to spread iterables to individual elements
It is used to describe a datatype of undefined size
No such operator exists
None of the above
Correct!
Wrong!
10. What will be the output of the following code snippet?
const example = ({ a, b, c }) => {
console.log(a, b, c);
};
example(0, 1, 2);
0 1 2
0 Undefined Undefined
Undefined Undefined Undefined
None of the above
Correct!
Wrong!
Share the quiz to show your results !
Subscribe to see your results
Ignore & go to results
JavaScript-Quiz-4
You got %%score%% of %%total%% right
%%description%%
%%description%%
Loading...