+ 4

What is the answer? Because 12 is not greater than 2 but the answer is true How it possible?

<script> document.write("2">"12"); </script>

29th Apr 2019, 3:40 AM
KHUSHbu
KHUSHbu - avatar
4 ответов
+ 4
In JavaScript 'a'>'b'; //false Because 'b' is after 'a' in string So '2'>'11' //true because 2 after 1 in string By number false because 11 larger then 2 See 'Ahmed'>'Basel' //false Try it by yourself ☺
29th Apr 2019, 5:38 AM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar
+ 6
refer to ascii table. Check “a”.charCodeAt() “A”.charCodeAt()
29th Apr 2019, 10:18 AM
\•/
\•/ - avatar
+ 5
A bit similar to alphabetical order such as in a dictionary but the characters include numeric and symbolic ones, with their ASCII codes being the basis of compassion.
29th Apr 2019, 6:51 AM
Sonic
Sonic - avatar
+ 4
Yeah \o/
29th Apr 2019, 10:19 AM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar