javascript - JS "Greater than" operator; -


this expression:

'33.33' > '100.00' 

return true. why?

if work like:

+'33.33' > +'100.00' 

it must return false because 33.33 < 100;

if like:

'33.33'.length > '100.00'.length 

then false, because 5 < 6;

i'm interested know, how work in first case;

ok. feel ashamed. while wrote & formated post, find answer.

for string compare js use lexicographical order; so, in case have just:

'3' > '1' 

and it's true.

maybe interesting someone.


Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -