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

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -