[go: up one dir, main page]

0% found this document useful (0 votes)
19 views77 pages

Javascript Interview Questions (MCQ) With Answers: PC Prajapat

Uploaded by

thrivex6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views77 pages

Javascript Interview Questions (MCQ) With Answers: PC Prajapat

Uploaded by

thrivex6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 77

PC Prajapat

Software engineer

200+ JavaScript
Interview Questions
(MCQ) with Answers

https://codebypc.in
PC Prajapat
Software engineer

1. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

2. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

3. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

https://codebypc.in
PC Prajapat
Software engineer

4. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

5. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

6. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

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


a) string
b) number
c) boolean
d) character
Answer: d) character

8. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

9. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array

https://codebypc.in
PC Prajapat
Software engineer

d) Sorts the array


Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

11. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

https://codebypc.in
PC Prajapat
Software engineer

12. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

13. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

14. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

15. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

16. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

https://codebypc.in
PC Prajapat
Software engineer

18. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

19. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types

https://codebypc.in
PC Prajapat
Software engineer

b) == checks for strict equality while === allows type conversion


c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

21. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

22. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

https://codebypc.in
PC Prajapat
Software engineer

23. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

24. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

25. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()

https://codebypc.in
PC Prajapat
Software engineer

Answer: a) JSON.parse()

26. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

28. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c

https://codebypc.in
PC Prajapat
Software engineer

Answer: d) b and c

29. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

31. Which of the following is a correct way to declare a variable in


JavaScript?
https://codebypc.in
PC Prajapat
Software engineer

a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

32. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

33. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

https://codebypc.in
PC Prajapat
Software engineer

34. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

35. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

36. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

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


a) string
b) number
c) boolean
d) character
Answer: d) character

38. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

39. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array

https://codebypc.in
PC Prajapat
Software engineer

Answer: b) Creates a new array with the results of calling a


function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

41. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

42. What is the output of console.log(typeof null);

https://codebypc.in
PC Prajapat
Software engineer

a) null
b) object
c) undefined
d) string
Answer: b) object

43. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

44. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

45. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

46. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

https://codebypc.in
PC Prajapat
Software engineer

48. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

49. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison

https://codebypc.in
PC Prajapat
Software engineer

d) None of the above


Answer: a) == compares values and === compares values and
types

51. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

52. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

53. What will console.log(2 + '2' - 1); print?

https://codebypc.in
PC Prajapat
Software engineer

a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

54. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

55. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

https://codebypc.in
PC Prajapat
Software engineer

56. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

58. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

https://codebypc.in
PC Prajapat
Software engineer

59. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

61. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
https://codebypc.in
PC Prajapat
Software engineer

c) const name = 'John';


d) All of the above
Answer: d) All of the above

62. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

63. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

64. What will be the output of console.log([] == []);

https://codebypc.in
PC Prajapat
Software engineer

a) true
b) false
c) undefined
d) NaN
Answer: b) false

65. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

66. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

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


a) string
b) number
c) boolean
d) character
Answer: d) character

68. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

69. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array

https://codebypc.in
PC Prajapat
Software engineer

Answer: b) Creates a new array with the results of calling a


function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

71. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

72. What is the output of console.log(typeof null);

https://codebypc.in
PC Prajapat
Software engineer

a) null
b) object
c) undefined
d) string
Answer: b) object

73. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

74. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

75. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

76. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

https://codebypc.in
PC Prajapat
Software engineer

78. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

79. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion

https://codebypc.in
PC Prajapat
Software engineer

c) == and === both perform strict equality comparison


d) None of the above
Answer: a) == compares values and === compares values and
types

81. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

82. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

https://codebypc.in
PC Prajapat
Software engineer

83. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

84. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

85. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

https://codebypc.in
PC Prajapat
Software engineer

86. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

88. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

https://codebypc.in
PC Prajapat
Software engineer

89. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

91. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
https://codebypc.in
PC Prajapat
Software engineer

b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

92. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

93. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

https://codebypc.in
PC Prajapat
Software engineer

94. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

95. Which method is used to convert a JSON string into an object?


a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

96. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

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


a) string
b) number
c) boolean
d) character
Answer: d) character

98. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

99. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array

https://codebypc.in
PC Prajapat
Software engineer

d) Sorts the array


Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

101. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

https://codebypc.in
PC Prajapat
Software engineer

102. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

103. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

104. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN

https://codebypc.in
PC Prajapat
Software engineer

Answer: b) false

105. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

106. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character

https://codebypc.in
PC Prajapat
Software engineer

Answer: d) character

108. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

109. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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

https://codebypc.in
PC Prajapat
Software engineer

a) == compares values and === compares values and types


b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

111. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

112. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string

https://codebypc.in
PC Prajapat
Software engineer

Answer: b) object

113. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

114. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

115. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()

https://codebypc.in
PC Prajapat
Software engineer

c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

116. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

118. How do you check if a variable is an array?


a) typeof variable === 'array'

https://codebypc.in
PC Prajapat
Software engineer

b) variable instanceof Array


c) Array.isArray(variable)
d) b and c
Answer: d) b and c

119. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above

https://codebypc.in
PC Prajapat
Software engineer

Answer: a) == compares values and === compares values and


types

121. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

122. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

123. What will console.log(2 + '2' - 1); print?

https://codebypc.in
PC Prajapat
Software engineer

a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

124. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

125. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

https://codebypc.in
PC Prajapat
Software engineer

126. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

128. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

https://codebypc.in
PC Prajapat
Software engineer

129. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

131. Which of the following is a correct way to declare a variable in


JavaScript?
https://codebypc.in
PC Prajapat
Software engineer

a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

132. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

133. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

https://codebypc.in
PC Prajapat
Software engineer

134. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

135. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

136. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

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


a) string
b) number
c) boolean
d) character
Answer: d) character

138. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

139. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array

https://codebypc.in
PC Prajapat
Software engineer

Answer: b) Creates a new array with the results of calling a


function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

141. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

https://codebypc.in
PC Prajapat
Software engineer

142. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

143. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

144. What will be the output of console.log([] == []);


a) true

https://codebypc.in
PC Prajapat
Software engineer

b) false
c) undefined
d) NaN
Answer: b) false

145. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

146. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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

https://codebypc.in
PC Prajapat
Software engineer

a) string
b) number
c) boolean
d) character
Answer: d) character

148. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

149. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array

https://codebypc.in
PC Prajapat
Software engineer

Answer: b) Creates a new array with the results of calling a


function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

151. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

https://codebypc.in
PC Prajapat
Software engineer

152. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

153. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

154. What will be the output of console.log([] == []);


a) true
b) false
c) undefined

https://codebypc.in
PC Prajapat
Software engineer

d) NaN
Answer: b) false

155. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

156. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

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


a) string

https://codebypc.in
PC Prajapat
Software engineer

b) number
c) boolean
d) character
Answer: d) character

158. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

159. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array

https://codebypc.in
PC Prajapat
Software engineer

Answer: b) Creates a new array with the results of calling a


function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

161. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

https://codebypc.in
PC Prajapat
Software engineer

162. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

163. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

164. What will be the output of console.log([] == []);


a) true

https://codebypc.in
PC Prajapat
Software engineer

b) false
c) undefined
d) NaN
Answer: b) false

165. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

166. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

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


a) string
b) number
c) boolean
d) character
Answer: d) character

168. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

169. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element

https://codebypc.in
PC Prajapat
Software engineer

c) Filters elements from an array


d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

171. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
c) const name = 'John';
d) All of the above

https://codebypc.in
PC Prajapat
Software engineer

Answer: d) All of the above

172. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

173. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

https://codebypc.in
PC Prajapat
Software engineer

174. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

175. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

176. What will console.log(0.1 + 0.2 === 0.3); return?


a) true
b) false
Answer: b) false

https://codebypc.in
PC Prajapat
Software engineer

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


a) string
b) number
c) boolean
d) character
Answer: d) character

178. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

179. What does map() do in JavaScript?

https://codebypc.in
PC Prajapat
Software engineer

a) Loops through an array and modifies each element


b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

181. Which of the following is a correct way to declare a variable in


JavaScript?
a) var name;
b) let name;
https://codebypc.in
PC Prajapat
Software engineer

c) const name = 'John';


d) All of the above
Answer: d) All of the above

182. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

183. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

https://codebypc.in
PC Prajapat
Software engineer

184. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

185. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

186. What will console.log(0.1 + 0.2 === 0.3); return?


a) true

https://codebypc.in
PC Prajapat
Software engineer

b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

188. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

https://codebypc.in
PC Prajapat
Software engineer

189. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
types

191. Which of the following is a correct way to declare a variable in


JavaScript?
https://codebypc.in
PC Prajapat
Software engineer

a) var name;
b) let name;
c) const name = 'John';
d) All of the above
Answer: d) All of the above

192. What is the output of console.log(typeof null);


a) null
b) object
c) undefined
d) string
Answer: b) object

193. What will console.log(2 + '2' - 1); print?


a) 3
b) 21
c) NaN
d) 22
Answer: b) 21

https://codebypc.in
PC Prajapat
Software engineer

194. What will be the output of console.log([] == []);


a) true
b) false
c) undefined
d) NaN
Answer: b) false

195. Which method is used to convert a JSON string into an


object?
a) JSON.parse()
b) JSON.stringify()
c) JSON.toObject()
d) JSON.objectify()
Answer: a) JSON.parse()

196. What will console.log(0.1 + 0.2 === 0.3); return?

https://codebypc.in
PC Prajapat
Software engineer

a) true
b) false
Answer: b) false

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


a) string
b) number
c) boolean
d) character
Answer: d) character

198. How do you check if a variable is an array?


a) typeof variable === 'array'
b) variable instanceof Array
c) Array.isArray(variable)
d) b and c
Answer: d) b and c

https://codebypc.in
PC Prajapat
Software engineer

199. What does map() do in JavaScript?


a) Loops through an array and modifies each element
b) Creates a new array with the results of calling a function on
every element
c) Filters elements from an array
d) Sorts the array
Answer: b) Creates a new array with the results of calling a
function on every element

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


a) == compares values and === compares values and types
b) == checks for strict equality while === allows type conversion
c) == and === both perform strict equality comparison
d) None of the above
Answer: a) == compares values and === compares values and
type

https://codebypc.in

You might also like