JavaScript Conditional Statements
JavaScript Conditional Statements - Important Points
21. | What is the output of the following code? var x = 5; |
---|
A. x is greater than 10
B. x is greater than 5 but less than or equal to 10
C. x is less than or equal to 5
D. None of the above
View Answer Discuss Work SpaceAnswer: option c
Explanation:
22. | Which of the following is the correct syntax for an if statement in JavaScript? |
---|
A. if x = 10 {
B. if (x == 10)
C. if (x = 10)
D. if [x == 10]
View Answer Discuss Work SpaceAnswer: option b
Explanation:
23. | What is the output of the following code? var x = 5; |
---|
A. x is greater than y
B. y is greater than x
C. x and y are equal
D. No output
View Answer Discuss Work SpaceAnswer: option b
Explanation:
24. | Which of the following is the correct syntax for a switch statement in JavaScript? |
---|
A. switch (x) {
B. switch (x == 10) {
C. switch x {
D. switch (x === "10") {
View Answer Discuss Work SpaceAnswer: option a
Explanation:
25. | What is the output of the following code? var x = 5; |
---|
A. x is 1
B. x is 2
C. x is not 1 or 2
D. No output
View Answer Discuss Work SpaceAnswer: option c
Explanation: