JavaScript Basic Programs for Beginners
JavaScript Basic Programs for Beginners - Important Points
6. | What is the output of the following program? console.log(10 % 3); |
---|
A. 1
B. 3.33
C. 3
D. 0.3
View Answer Discuss Work SpaceAnswer: option a
Explanation:
7. | Which of the following is the correct way to write an if statement in JavaScript? |
---|
A. if (condition) { // code }
B. if (condition) then { // code }
C. if (condition) -> { // code }
D. if (condition) = { // code }
View Answer Discuss Work SpaceAnswer: option a
Explanation:
8. | What is the output of the following program? console.log("hello".toUpperCase()); |
---|
A. HELLO
B. hello
C. hElLo
D. null
View Answer Discuss Work SpaceAnswer: option a
Explanation:
9. | Which of the following is NOT a valid JavaScript data type? |
---|
A. number
B. string
C. array
D. tuple
View Answer Discuss Work SpaceAnswer: option d
Explanation:
10. | What is the output of the following code snippet? console.log(Math.floor(4.7)); |
---|
A. 4.7
B. 5
C. 4
D. 0.7
View Answer Discuss Work SpaceAnswer: option c
Explanation: