Day 3

aronson(25)
Published in
#coding
Words
207
Reading
1 min
Listen
Play
9y

January 17th 2018

Today’s JavaScript project was to sort bands names without the articles in front of them. In a given array of strings, band names some having articles you had to sort the name alphabetically but without the articles in front. This one needed only one function to take off the articles from the band which used the .replace() method with some regex like this:

.replace(/^(a |the |an )/i, '').trim()
.trim() is there so no space is left after the sorting.

Other methods used in this one are .sort() (pretty obvious) and the .join(). I saw another example of innerHTML which is used to populate a document with a given information. Here we used innerHTML to put the sorted array in the document and to .map() it.

In the CSS side, I coded along with Colt to create a fictional dating app for cats and people. Apart from Bootstrap I used fontawesome and google.fonts which can add a really nice look to the webapp. Overall I enjoy creating websites, the design at least for now. CSS is extremely powerful, you can change the feel and look of a page completely, I will make sure to use it and study it more in the more future.

Logging out!

Day 3 | Ecency