0
0
Javascriptprogramming~5 mins

Comparison operators in Javascript - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the == operator do in JavaScript?
The == operator compares two values for equality, allowing type conversion if needed. For example, 5 == '5' is true because the string '5' is converted to number 5 before comparison.
Click to reveal answer
beginner
What is the difference between == and ===?
== checks for equality with type conversion, while === checks for equality without type conversion (strict equality). So 5 == '5' is true, but 5 === '5' is false.
Click to reveal answer
beginner
What does the != operator do?
The != operator checks if two values are not equal, allowing type conversion. For example, 5 != '6' is true because 5 is not equal to 6 after conversion.
Click to reveal answer
beginner
How do the < and > operators work?
The < operator checks if the value on the left is less than the value on the right. The > operator checks if the left value is greater than the right value. Both compare numbers or strings based on Unicode order.
Click to reveal answer
beginner
What is the purpose of <= and >= operators?
The <= operator checks if the left value is less than or equal to the right value. The >= operator checks if the left value is greater than or equal to the right value.
Click to reveal answer
What will 5 == '5' return in JavaScript?
Aundefined
Bfalse
CTypeError
Dtrue
Which operator checks equality without type conversion?
A!=
B===
C==
D<=
What does 10 >= 10 evaluate to?
Atrue
BTypeError
Cundefined
Dfalse
What is the result of 'apple' < 'banana'?
Afalse
BTypeError
Ctrue
Dundefined
Which operator means 'not equal' with type conversion?
A!=
B!==
C===
D==
Explain the difference between == and === operators in JavaScript.
Think about how JavaScript treats types when comparing.
You got /4 concepts.
    List and describe the main comparison operators used to compare numbers or strings in JavaScript.
    Focus on operators that compare values and their meanings.
    You got /4 concepts.