Why does JavaScript consider "," to be smaller than "."? -
this question has answer here:
alert("," < ".")
returns true
in javascript.
so why "," smaller "."?
as mdn because:
strings compared based on standard lexicographical ordering, using unicode values.
which internally means ( ord(',') < ord('.') ) == ( 44 < 46 )
.
Comments
Post a Comment