Site icon i2tutorials

JavaScript-Quiz-3

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



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

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


 true false
false true
true true
false false

Correct!

Wrong!



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

var a = true + true + true * 3;
print(a)


0
3
5
error

Correct!

Wrong!



3. What is the output of the following code snippet?


print(NaN === NaN);







true






false






undefined






Error



true
false
error
undefined

Correct!

Wrong!



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


print(typeof(NaN));


Object
Number
string
None of the above

Correct!

Wrong!

5. What does the ‘toLocateString()’ method do in JS?
Returns a localised object representation.
Returns a parsed string.
Returns a localized string representation of an object.
None of the above.

Correct!

Wrong!

6. The process in which an object or data structure is translated into a format suitable for transferral over a network, or storage is called?
Object Serialization
Object Encapsulation
Object Inheritance
None of the above

Correct!

Wrong!

7. Which function is used to serialize an object into a JSON string in Javascript?
stringify()
parse()
convert()
None of the above

Correct!

Wrong!

8. The 3 basic object attributes in Javascript are
Class, prototype, objects' parameters.
Class, prototype, object's extensible flag.
Class, parameters, object's extensible flag.
Classes, Native object, and Interfaces and Object's extensible flag.

Correct!

Wrong!



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

let sum = 0; 
const a = [1, 2, 3];
a.forEach(getSum);
print(sum);
function getSum(ele) {
sum += ele;
}


1
2
6
None of the above

Correct!

Wrong!



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

a = [1, 2, 3, 4, 5];
print(a.slice(2, 4));


3, 4
2, 3
3, 4, 5
2, 3, 4

Correct!

Wrong!

Share the quiz to show your results !

Subscribe to see your results

Ignore & go to results

JavaScript-Quiz-3

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

%%description%%

%%description%%

Where to go ?

Quizzes

Loading...

Exit mobile version