Leanpub Header

Skip to main content

Lodash 4 Cookbook

For lodash 4.17.21

Start learning lodash 4 from this book. Lodash can increase your productivity dramatically in your daily development. It's an essential tool in your JavaScript toolbox. This book talks about lodash in a systematic way and explains some complicated parts, especially functional programming. This book includes content for lodash v4.17.21.

The author is letting you choose the price you pay for this book!

Pick Your Price...

Buying multiple copies for your team? See below for a discount!

PDF
EPUB
WEB
About

About

About the Book

In modern web development, JavaScript is a must-to-learn programming language. Using JavaScript is not an easy task. Most of JavaScript APIs are low-level APIs, which are hard to learn and use. Lodash is a popular JavaScript utility framework. It provides a lot of high-level APIs which are more convenient to remember and use. Developers can dramatically increase productivity by using lodash.

This book is a very good start point to learn lodash 4 and apply it in practice. It covers core concepts and functions provided by lodash with real examples. For some complicated functions, e.g. functions related to functional programming, this book has a more detailed explanation.

Most of the code examples are written as Jest test cases with ES6.

Lodash is no longer updating, so there won't be further updates to this book.

Share this book

Price

Pick Your Price...

Minimum price

$10.00

$15.00

You pay

$15.00

Author earns

$12.00
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 1)

1
The author will earn $12.00 from your purchase!
You can get credits monthly with a Reader Membership

Team Discounts

Team Discounts

Get a team discount on this book!

  • Up to 3 members

    Minimum price
    $25.00
    Suggested price
    $37.00
  • Up to 5 members

    Minimum price
    $40.00
    Suggested price
    $60.00
  • Up to 10 members

    Minimum price
    $70.00
    Suggested price
    $105.00
  • Up to 15 members

    Minimum price
    $100.00
    Suggested price
    $150.00
  • Up to 25 members

    Minimum price
    $150.00
    Suggested price
    $225.00

Author

About the Author

Fu Cheng

Full-stack software developer and content creator.

Contents

Table of Contents

1.Introduction

  1. 1.1Installation
  2. 1.1.1Web
  3. 1.1.2NodeJS
  4. 1.2Lodash features
  5. 1.3Code sample convention
  6. 1.4About this book

2.Common concepts

  1. 2.1Truthy and falsy
  2. 2.2SameValueZero
  3. 2.3Predicates
  4. 2.3.1matches
  5. 2.3.2matchesProperty
  6. 2.3.3property
  7. 2.4Iteratees
  8. 2.4.1Iteratee shorthand
  9. 2.5this binding

3.Collections

  1. 3.1Each
  2. 3.2Every and some
  3. 3.3Filter and reject
  4. 3.4Size
  5. 3.5Includes
  6. 3.6Sample
  7. 3.7Shuffle
  8. 3.8Partition
  9. 3.9Count by
  10. 3.10Group by and key by
  11. 3.11invokeMap
  12. 3.12Map and reduce
  13. 3.12.1Map
  14. 3.12.2Reduce
  15. 3.13Search
  16. 3.13.1find
  17. 3.13.2findLast
  18. 3.14Sort
  19. 3.15flatMap

4.Arrays

  1. 4.1Search
  2. 4.2Set operations
  3. 4.2.1Equality comparisons
  4. 4.2.2Unique
  5. 4.2.3Union
  6. 4.2.4Difference
  7. 4.2.5Intersection
  8. 4.2.6Symmetric difference
  9. 4.3Chunk
  10. 4.4Compact
  11. 4.5Fill
  12. 4.6Flatten
  13. 4.7Remove
  14. 4.7.1remove
  15. 4.7.2pull
  16. 4.7.3pullAt
  17. 4.7.4pullAll
  18. 4.7.5without
  19. 4.8Zip
  20. 4.8.1zip
  21. 4.8.2zipWith
  22. 4.8.3zipObject
  23. 4.8.4zipObjectDeep
  24. 4.8.5unzip
  25. 4.9Partition
  26. 4.9.1first
  27. 4.9.2last
  28. 4.9.3initial
  29. 4.9.4tail
  30. 4.10Slicing
  31. 4.10.1Basic slicing
  32. 4.10.2Drop elements
  33. 4.10.3Take elements
  34. 4.11Sorted arrays
  35. 4.12Concatenation
  36. 4.13From pairs
  37. 4.14Join
  38. 4.15Reverse
  39. 4.16Nth element

5.Objects

  1. 5.1Assign
  2. 5.1.1assign
  3. 5.1.2assignIn
  4. 5.1.3assignInWith
  5. 5.2Merge
  6. 5.2.1merge
  7. 5.2.2mergeWith
  8. 5.3Transform
  9. 5.4Create
  10. 5.5Default values
  11. 5.6Function names
  12. 5.6.1functions
  13. 5.6.2functionsIn
  14. 5.7Invert
  15. 5.7.1invert
  16. 5.7.2invertBy
  17. 5.8Keys and values
  18. 5.8.1has
  19. 5.8.2hasIn
  20. 5.8.3keys and keysIn
  21. 5.8.4values and valuesIn
  22. 5.8.5mapValues
  23. 5.8.6mapKeys
  24. 5.8.7result
  25. 5.8.8toPairs and toPairsIn
  26. 5.9Pick and omit
  27. 5.9.1pick and pickBy
  28. 5.9.2omit and omitBy
  29. 5.10Iterate
  30. 5.10.1forIn and forInRight
  31. 5.10.2forOwn and forOwnRight
  32. 5.11Get and set
  33. 5.11.1get
  34. 5.11.2set
  35. 5.11.3setWith
  36. 5.11.4update
  37. 5.12At
  38. 5.13Find key

6.Functions

  1. 6.1Bind
  2. 6.2Before and after
  3. 6.2.1before
  4. 6.2.2after
  5. 6.3Ary
  6. 6.4Partial
  7. 6.4.1partial
  8. 6.4.2partialRight
  9. 6.5Curry
  10. 6.6Flow
  11. 6.7Defer
  12. 6.8Once
  13. 6.9Negate
  14. 6.10Spread
  15. 6.11Wrap
  16. 6.12Rearg
  17. 6.13Rest parameters
  18. 6.14Debounce and throttle
  19. 6.14.1Debounce
  20. 6.14.2Throttle
  21. 6.15Memoize
  22. 6.16Modify arguments
  23. 6.17Flip arguments

7.Strings

  1. 7.1Character cases
  2. 7.1.1capitalize
  3. 7.1.2camelCase
  4. 7.1.3snakeCase
  5. 7.1.4kebabCase
  6. 7.1.5startCase
  7. 7.2Search
  8. 7.3Escape
  9. 7.4Pad
  10. 7.5Trim
  11. 7.6Repeat
  12. 7.7Truncate
  13. 7.8parseInt
  14. 7.9Words
  15. 7.10Replace
  16. 7.11Split
  17. 7.12Uppercase and lowercase
  18. 7.12.1upperCase
  19. 7.12.2upperFirst
  20. 7.12.3toUpper
  21. 7.12.4lowerCase
  22. 7.12.5lowerFirst
  23. 7.12.6toLower

8.Miscellaneous

  1. 8.1Types
  2. 8.1.1Type check
  3. 8.1.2Type conversion
  4. 8.2Clone
  5. 8.3Date
  6. 8.4Math
  7. 8.4.1Add
  8. 8.4.2Subtract
  9. 8.4.3Multiply
  10. 8.4.4Divide
  11. 8.4.5Max
  12. 8.4.6Min
  13. 8.4.7Sum
  14. 8.4.8Ceil
  15. 8.4.9Floor
  16. 8.4.10Round
  17. 8.4.11Mean
  18. 8.5Number
  19. 8.5.1inRange
  20. 8.5.2clamp
  21. 8.5.3Random numbers
  22. 8.6Comparison
  23. 8.6.1isEqual and isEqualWith
  24. 8.6.2eq
  25. 8.6.3gt and gte
  26. 8.7Utilities
  27. 8.7.1attempt
  28. 8.7.2constant
  29. 8.7.3identity
  30. 8.7.4noop
  31. 8.7.5noConflict
  32. 8.7.6Range
  33. 8.7.7times
  34. 8.7.8uniqueId
  35. 8.7.9Method
  36. 8.7.10cond
  37. 8.7.11conforms
  38. 8.7.12nthArg
  39. 8.7.13over, overEvery and overSome
  40. 8.7.14toPath
  41. 8.7.15castArray
  42. 8.8Stub
  43. 8.9Default to

9.Chaining

  1. 9.1Wrapper
  2. 9.2Explicit chaining
  3. 9.3tap
  4. 9.4thru

10.String Templates

  1. 10.1interpolate
  2. 10.2escape
  3. 10.3evaluate
  4. 10.4imports
  5. 10.5Data object name

11.Recipes

  1. 11.1Filter an object’s properties
  2. 11.1.1Scenario
  3. 11.1.2Solution
  4. 11.2Push an array of elements into an array
  5. 11.2.1Scenario
  6. 11.2.2Solution
  7. 11.3Process data for C3.js pie chart
  8. 11.3.1Scenario
  9. 11.3.2Solution
  10. 11.4Create a unique array of objects
  11. 11.4.1Scenario
  12. 11.4.2Solution
  13. 11.5Convert an array to an object
  14. 11.5.1Scenario
  15. 11.5.2Solution

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub