Instructions
- 1. Your final score will reflect your grasp of the concepts—approach each question with precision.
- 2. Thoroughly review each solution before proceeding to ensure full understanding.
- 3. Final results will be available after submission to provide insights into areas for further improvement.
- 4. Maintain academic integrity—plagiarism undermines learning and professional growth.
- 5. Once submitted, responses are final, so ensure you’re confident in your answers.
- 6. These challenges are designed to test practical knowledge; apply your skills as you would in real-world scenarios.
All Problems
Question
Action
What is the purpose of an if statement in JavaScript?
What is the correct syntax for an if statement in JavaScript?
What does the following code output?
How many else if statements can you have in an if-else construct?
What will the following code output?
What is the purpose of the else statement?
What will this code print?
What is wrong with this code?
What does this code print?
What happens when you use an if-else statement without an else?
What is the purpose of an if statement in JavaScript?
What is the correct syntax for an if statement in JavaScript?
What does the following code output?
let x = 5; if (x > 3) { console.log("Greater than 3"); } else { console.log("Less than or equal to 3"); }
How many else if statements can you have in an if-else construct?
What will the following code output?
let y = 10; if (y === 5) { console.log("y is 5"); } else if (y > 5) { console.log("y is greater than 5"); } else { console.log("y is less than 5"); }
What is the purpose of the else statement?
What will this code print?
let a = 7; if (a > 10) { console.log("Greater than 10"); } else if (a === 7) { console.log("Equal to 7"); } else { console.log("Less than 7"); }
What is wrong with this code?
let b = 4; if b === 4 { console.log("b is 4"); }
What does this code print?
let c = 15; if (c < 10) { console.log("Less than 10"); } else { console.log("10 or greater"); }