0

JavaScript

In learning JavaScript, is it necessary for me to understand why ā€œAā€ > ā€œBā€ is false Or True + false is 1 ?

2nd Jan 2022, 8:30 AM
Ogu Charles Chukwudi
Ogu Charles Chukwudi - avatar
3 Answers
+ 2
Yes...
2nd Jan 2022, 8:57 AM
Lisa
Lisa - avatar
+ 3
IMO understanding is key to success. read https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Less_than same apply to Greater than. a) If both values are strings, they are compared as strings, based on the values of the Unicode code points they contain. b) Boolean valuesĀ trueĀ andĀ falseĀ are converted to 1 and 0 respectively.
2nd Jan 2022, 9:04 AM
arturop200
arturop200 - avatar
2nd Jan 2022, 10:06 AM
FanYu
FanYu - avatar