Data Manipulation in Javascript

Wow just from exercise 4.7 from FullStackOpen I’ve learned 3 very important and useful things within a one line solution. This is the solution in question: 1 2 3 Object.entries(_.countBy(blogs, 'author')).sort((a,b) => { return b[1] - a[1] })[0] It took me several hours to figure out this exercise. This is because first I needed to get myself introduced to Lodash - and then, I got introduced to Object.entries, a way to convert an object into an array. Next, I needed to figure out how sort() works. Overall….I feel quite accomplished. But I’ll just need to document everything I’ve learned from this exercise below. ...

September 13, 2021 · 6 min · Lei