What is the answer? Because 12 is not greater than 2 but the answer is true How it possible? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Respostas
+ 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