Recent contacts view on home screen

Hi guys, I've added some logic to create the recent contacts view. It took me a while and a lot of searching to create this functionality. With this branch, recent contacts are parsed in home.js, and listed out in descending order by the number of occurrence (the more common a name appears on screen, the higher it is on the list).
The number of contacts is limited to 5 and the user's own name is omitted from the list.

 However, there is still a part where I still don't understand (I know, I coded this up O_o). Particularly between line 124 to 134 of home.js. 
Hopefully y'all can shed some light on this and review the PR in the meantime!

Cheers! :smiley: 
Ahh great point, your previous solution accounts for removing the user's own name, while this one doesn't.  In order to filter out oneself, the if statement that you used earlier could probably be applied here.

For the `el.dataset.id` error, an undefined error probably means that dataset is not defined.  The purpose of using dataset.id is to get the `<span class="name" data-id="..."...>`'s data-id value, which should be a unique identifier.  I thought this would work because on line 118, I think you used `$name.eq(i).data("id")` to get the user ids.  I wonder, have you tried doing `$(el).data('id')` instead of the dataset.id?  Maybe element wasn't correctly selected or something.

To your aside: there really is no apparent functional difference between counting vs $.length approaches.  On the outside, they look just the same.  The main difference, I think, is that the $.length method would hopefully be shorter and more concise.  Also, when logic such as keeping track of userCount and incrementing it gets spread throughout a program, that means there are more places to check when the logic needs to be updated.  Really, this is not a huge concern here, but I think that the reduction to $.length might be able to keep our overall code shorter and cleaner.

Hm, I hope this works!