JavaScript Basics
JavaScript Basics - Important Points
| 26. | Which of the following is a valid way to declare a variable in JavaScript? |
|---|
A. variable name = value;
B. var name = value;
C. let name = value;
D. all of the above
View Answer Discuss Work SpaceAnswer: option c
Explanation:
| 27. | What is the output of the following code? console.log(3 === "3"); |
|---|
A. 1
B. 0
C. NaN
D. null
View Answer Discuss Work SpaceAnswer: option b
Explanation:
| 28. | What is the output of the following code? console.log("2" * "3"); |
|---|
A. 5
B. 6
C. 23
D. 6
View Answer Discuss Work SpaceAnswer: option b
Explanation:
| 29. | Which of the following is a valid way to create a function in JavaScript? |
|---|
A. function myFunction() {}
B. var myFunction = function() {};
C. const myFunction = () => {};
D. all of the above
View Answer Discuss Work SpaceAnswer: option d
Explanation:
| 30. | What is the output of the following code? console.log("hello".toUpperCase()); |
|---|
A. HELLO
B. hello
C. undefined
D. null
View Answer Discuss Work SpaceAnswer: option a
Explanation: