18.
What are comparison operators used for in JavaScript?
To define variables and assign values to them.
To perform mathematical calculations.
To combine multiple expressions into a single value.
To compare values and return a boolean result.
Correct: D
Comparison operators in JavaScript are used to compare two values or variables and return a boolean result, either true or false, based on the comparison. These operators include equality (==), inequality (!=), strict equality (===), strict inequality (!==), greater than (>), less than (<), greater than or equal to (>=), and less than or equal to (<=). They are commonly used in conditional statements to determine the flow of execution based on the comparison result.