After that short 5 minute micro-talk covering Lodash/FP, I'm sure that everyone's definitely an expert! However there's a couple of challenges that we can do to see this in action! π€
We've got ~15 minutes for this so that's plenty of time to have a beer and have a go at using lodash. π
You have a dataset that consists of a mixture of accounts for a user, this is similar to what we might face at WonderBill with our timeline ;).
We want to return the most expensive bill for a user from data that's returned from the api. You have a function called getMostExpensiveBill(accounts)
, this will need fixing and should give you a little taste of using lodash at the very least.
Look inside
exercise_one.js
https://stackblitz.com/edit/lodashfp-ex-1?file=exercise_one.js
We've just created our function that returns the most expensive bill, now lets try and get back a collection using some more intricate lodash.
You have a function called getTotalBillAmountByMonth(accounts), this will need implementing and will give you a taste of some gnarly lodash.
Look inside
exercise_two.js
https://stackblitz.com/edit/lodashfp-ex-2?file=exercise_two.js
- If you can't use the exercise links above? https://stackblitz.com/@kepop1
- Where is the documentation? https://lodash.com/
- Where is the FP documentation? https://github.com/lodash/lodash/wiki/FP-Guide
- No I really need help? Erm ... Google? Stack Overflow? All that good stuff...
- Or if you're at the Kata come and grab the big ginger bloke with the yorkshire accent! πͺ