Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1.08 KB

File metadata and controls

45 lines (32 loc) · 1.08 KB

#Underscore and Lodash(Not ready)

Outcome

You will understand what underscore and lodash are and why you should use them when you're programming Javascript.

Advice

Javascript doesn't come alot of core libraries. So you end up writing quite alot of code yourself. Thankfully underscore was invented which provides a tonne of useful functions to help you out.

Underscore is particularly useful for it's operations on collections.

Lodash and Underscore serve the same purpose and are 98% the same as far as I can tell. Lodash is the new hotness, so we'll use that 😄

Functions which I use often:

  • Map
  • Find
  • Filter
  • Where
  • FindWhere
  • Reject
  • Every
  • Some
  • Contains
  • SortBy
  • GroupBy
  • Compact
  • Flatten
  • Debounce (useful for UI stuff sometimes)
  • Clone
  • IsEqual

Learning materials

Tasks

  • Run through the learning materials
  • Build an example of 5 of the above function I said I used locally.
  • Convert your examples to use lodash and see if they work.