Almighty Gurus, Please tell me, I want to know can comparison sm. set of variables in row, like this:
x < y >= z
or i need to do it in two steps?
(x < y) && (y >= z)
== in JavaScript is used for comparing two variables, but it ignores the datatype of variable. === is used for comparing two variables, but this operator also checks datatype and compares two values. Checks the equality of two operands without considering their type.
The strict equality operator ( === ) checks whether its two operands are equal, returning a Boolean result. Unlike the equality operator, the strict equality operator always considers operands of different types to be different.
Because == (and === ) test to see if two objects are the same object and not if they are identical objects.
The triple equals operator ( === ) returns true if both operands are of the same type and contain the same value. If comparing different types for equality, the result is false. This definition of equality is enough for most use cases.
In Javascript, you must do this type of comparison in two steps.
Python is the only widely used language I'm aware of that allows the first form (please comment if I'm incorrect).
You can only do the latter in Javascript:
(x < y) && (y >= z)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With