Bram's Dev Blog

home

100 Days of Code Day 43 - ng-book 2 p73-82

03 Oct 2018

sort() and arrow functions

In a one line example on p82, both sort() and Arrow (=>) functions are introduced.

sortedArticles(): Article[] {
return this.articles.sort((a: Article, b: Article) => b.votes - a.votes);
}

I went through part of the docs on Arrow functions and Sort but both of them were quite deep rabbit holes.

What I get from it is that sort() gives you a default unicode sort operation on an array, but can also take in a comparator function, in order to sort by a specific comparison.

The arrow functions in their turn, make it easier to write shorter functions. But I have the feeling those are docs I’ll need to refer again to later.

Day 44 Plan

Take a break from ng-book and have a look at DSpace 7. Goal would be just to look around the documentation of what’s already done, and go through the codebase, and write down everything I don’t understand yet. This set of questions/topics might give me a good direction of knowing what to look for, as I plow further through the book.

Future days - DSpace 7 Angular

Future days - Analyzer.atmire.com work

Future Days - Productivity

Future days - Jekyll http://bram-atmire.github.io/ site

Future Days - Atmire.com work

Investigate and work on search engine optimization (SEO) for the main atmire.com website.

Future Days - Learning just for learning

September sustainability challenge - Completed

The money has been wired and I’m closing the books on the September sustainability challenge where I was sponsored for every successful day and where I would punish myself for every missed day.

New sustainability challenge - Finish before Christmas

With today being day 43, there are 57 days of coding left. Setting the goal to get there before Dec 25th gives me a little more flexibility while still requiring a high frequency.

In terms of positive motivator, I’m currently thinking along the lines of a big reward at the end, while at the same time still wondering about something more incremental for Oct/Nov, or to have a self-punishment system in here as well.