Answer the question
In order to leave comments, you need to log in
Why are back-to-front comparisons used, such as false == obj.prop.subProp?
I often meet, especially in all kinds of checks, in third-party code constructions like
false == obj.prop.subProp
or
1 == arr[8]
, etc.
It seems that the order "what" == "with what" or "variable" == "constant" is perceived as normal. Why
are "back to front" comparisons sometimes used, such as false == obj.prop.subProp?
Answer the question
In order to leave comments, you need to log in
It's called Yoda-style.
true/false is not accidentally assigned to a variable by mistake.
On the left, this value will be in the condition if, at the compilation stage, you will receive an error.
It doesn't really matter, young Padawan
But someone writes like this - he is already close to the dark side of the force
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question