Interesting Quizzes!-JavaScript dated 14/03/2023

Hello Everyone!

Please reply your answer for below questions.

1.What is JavaScript?

a) A programming language used to create interactive effects within web browsers.

b) A database management system.

c) A markup language used to structure web content.

2.Which of the following is not a JavaScript data type?

a) String

b) Boolean

c) Float

d) Object

3.What is the difference between == and === in JavaScript?

a) They are interchangeable and can be used interchangeably.

b) == compares values and === compares both values and data types.

c) === compares values and == compares both values and data types.

d) None of the above.

4.What is the purpose of the “this” keyword in JavaScript?

a) To refer to the current function.

b) To refer to the parent object.

c) To refer to the global object.

d) To refer to the current object.

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

for (var i = 0; i < 5; i++) {
  setTimeout(function() {
    console.log(i);
  }, 1000);
}

a) 0 1 2 3 4
b) 5 5 5 5 5
c) 1 2 3 4 5
d) None of the above.

Have a Happy Learning

Thanks & Regards

Teaching Assistant,
Dharshini M.

1 Like

1.Ans:- A
2.Ans:- C
3.Ans:- B
4.Ans:- C
5.Ans:- B