Which keyword is used to check a condition in JavaScript?
- for
- if
- while
- switch
The keyword used to check a condition in JavaScript is if. It allows you to execute a block of code if a specified condition evaluates to true. The if statement is fundamental for controlling the flow of your JavaScript program.
Loading...
Related Quiz
- How does the ‘this’ keyword behave differently when used inside a function declaration versus a function expression?
- In a code review, you spot the line const arr = [10, 20, 30]; followed by arr = [40, 50, 60];. What will be the outcome when this code is executed?
- When using querySelectorAll, the returned object is a _______.
- Which of the following best describes a JavaScript callback function?
- Why might for...of loops be preferred when working with asynchronous code?