0% found this document useful (0 votes)
3 views4 pages

100 JavaScript Output Based Questions

This document contains a list of 100 JavaScript output-based interview questions designed to test knowledge of JavaScript data types, type coercion, and various console outputs. Each question is presented with a console.log statement that demonstrates a specific JavaScript behavior or concept. The questions cover a wide range of topics including null, undefined, arrays, objects, and operators.

Uploaded by

dk7923843
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)
3 views4 pages

100 JavaScript Output Based Questions

This document contains a list of 100 JavaScript output-based interview questions designed to test knowledge of JavaScript data types, type coercion, and various console outputs. Each question is presented with a console.log statement that demonstrates a specific JavaScript behavior or concept. The questions cover a wide range of topics including null, undefined, arrays, objects, and operators.

Uploaded by

dk7923843
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

100 JavaScript Output-Based Interview Questions

1. [Link](typeof null);

2. [Link](typeof undefined);

3. [Link](1 + "2" + 3);

4. [Link]("5" - 3);

5. [Link]([] + []);

6. [Link]([] == 0);

7. [Link](0 == false);

8. [Link](0 === false);

9. [Link](false == "0");

10. [Link]([] == false);

11. [Link]("foo" + + "bar");

12. [Link]("foo" + + "2");

13. [Link](+true);

14. [Link](!"false");

15. [Link]([] == []);

16. [Link]({} == {});

17. [Link]([1,2] == "1,2");

18. [Link](0.1 + 0.2 == 0.3);

19. [Link](Number(" 123 "));

20. [Link](parseInt("12px"));

21. [Link](parseInt("px12"));

22. [Link]("5" + 3 * 2);

23. [Link]("5" * 2);

24. [Link](2 ** 3);

25. [Link](2 << 1);

26. [Link]("5" > 3);

Page 1
100 JavaScript Output-Based Interview Questions

27. [Link]("5" > "3");

28. [Link](typeof NaN);

29. [Link](NaN === NaN);

30. [Link](isNaN("foo"));

31. [Link]([] + 1);

32. [Link]({} + 1);

33. [Link]("use strict"; var x = 1; delete x;);

34. [Link](typeof function() {});

35. [Link](typeof Symbol());

36. [Link](Symbol("id") === Symbol("id"));

37. [Link](0 || "foo");

38. [Link](null ?? "bar");

39. [Link](undefined ?? "bar");

40. [Link](false ?? "bar");

41. [Link]("hello".charAt(0));

42. [Link]("hello"[1]);

43. [Link]("hello".length);

44. [Link]("hello".toUpperCase());

45. [Link](" test ".trim());

46. [Link]([1, 2, 3].map(x => x * 2));

47. [Link]([1, 2, 3].filter(x => x > 1));

48. [Link]([1, 2, 3].reduce((a,b) => a + b, 0));

49. [Link](new Array(3).length);

50. [Link](Array(3));

51. [Link](Array(3).map(x => 5));

52. [Link]([,,,].length);

Page 2
100 JavaScript Output-Based Interview Questions

53. [Link](typeof NaN);

54. [Link](typeof null);

55. [Link](typeof []);

56. [Link](typeof {});

57. [Link](typeof undefined);

58. [Link](typeof (() => {}));

59. [Link](typeof function() {});

60. [Link](typeof 42);

61. [Link](typeof "42");

62. [Link]([] instanceof Array);

63. [Link]({} instanceof Object);

64. [Link]([] instanceof Object);

65. [Link]("abc" instanceof String);

66. [Link](new String("abc") instanceof String);

67. [Link](!!null);

68. [Link](!!undefined);

69. [Link](!!"");

70. [Link](!!0);

71. [Link](!!NaN);

72. [Link](!!"0");

73. [Link](!![]);

74. [Link](!!{});

75. [Link]([] + {});

76. [Link]({} + []);

77. [Link]({} + {});

78. [Link]("1" + 2 + 3);

Page 3
100 JavaScript Output-Based Interview Questions

79. [Link](1 + 2 + "3");

80. [Link](1 + +"2" + "3");

81. [Link]("3" - 1);

82. [Link]("3" + 1);

83. [Link](3 > 2 > 1);

84. [Link](3 > 2 >= 1);

85. [Link](0 == "");

86. [Link](0 === "");

87. [Link](null == undefined);

88. [Link](null === undefined);

89. [Link]([] == "");

90. [Link]([] === "");

91. [Link]([1] == true);

92. [Link]([1] === true);

93. [Link](typeof typeof 1);

94. [Link](typeof (typeof 1));

95. [Link](+"-0");

96. [Link](+true);

97. [Link]("2" * "3");

98. [Link]("2" + "3");

99. [Link](1 + 2 + "3" + 4 + 5);

100. [Link](typeof NaN);

Page 4

You might also like