Photo by Charles Deluvio on Unsplash

Basic Understanding of Sort Method

The sort() method, as its name suggests, sorts every element in an array.

By default, the elements are converted into strings and sorted in ascending order based on UTF-16 code unit values.

If the array contains various types of characters such as signs, numbers, and letters with different cases, the order would be like this; signs* > numbers > upper case letters > lower case letters.
*with exceptions

HTML and CSS Syntax image top
HTML and CSS Syntax image top

When I started to learn to code, I just had been focusing to write code without causing errors.

However, when you search and read any documents or ask someone to solve the errors, knowing the syntax and being able to speak with those names would make your coding life easier.

I remember how it looks like and how to code, but somehow I tend to forget the name of each part of the syntax.
For those who (if there are someone like me out there), here is the note that might well come back and check now and then.

HTML Syntax


Japanese women who code at home.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store