Javascript - Mock Interview Test

1. What will be the output of the following code?
console.log(0.1 + 0.2 == 0.3);

2. What is the purpose of the `bind()` method in JavaScript?

3. Which of the following is a JavaScript data type?

4. What is the result of the following code?
console.log(2 + '2');

5. What does `localStorage` do in JavaScript?

6. What is the difference between `null` and `undefined`?

7. Which operator is used to check if two values are equal and of the same type?

8. What will the following code output?
console.log([1] == 1);

9. Which of the following is a feature of a JavaScript promise?

10. What does the `this` keyword refer to in JavaScript?

11. What does `Array.prototype.map()` do?

12. Which of the following is used to define a function in JavaScript?

13. What is the correct way to add a comment in JavaScript?

14. Which method is used to select a single DOM element in JavaScript?

15. What is the result of the following expression in JavaScript?
console.log(5 + '5');

16. How do you create a new array in JavaScript?

17. What is the purpose of the `addEventListener()` method in JavaScript?

18. How do you define an object in JavaScript?

19. What is `typeof` used for in JavaScript?

20. What does `console.log()` do in JavaScript?