Skip to content

I frequently use the lodash functional library and in order to expand my knowledge on how some of the functions work i decided to implement my own version of the functions before looking at the source code and then compare them with the lodash source code.

Notifications You must be signed in to change notification settings

sinacodes95/Reimplement-lodash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reimplmenting Lodash functional library Part 1

Tests

To run the tests made for these functions: - clone this repository - run npm intall in the command line - run npm test in the command line

Challenge

The Lodash functional library Sprint involves reimplementing a JS library as if you were its author. For Part 1 of this sprint, reimplement the following methods:

Core

These are the core functions to get finished;

  1. identity
  2. first
  3. last
  4. each
  5. indexOf
  6. filter
  7. reject
  8. uniq
  9. map
  10. contains

Resources:

  1. Lodash
  2. The Mocha Test Framework
  3. The Chai Assertion Library

Advanced

These are a little harder but will be very beneficial to try and complete.

  1. pluck
  2. reduce
  3. every
  4. some
  5. extends
  6. defaults

Lodash functional library Part 2 (more advanced)

Tasks

  1. once
  2. memoize
  3. shuffle
  4. invoke
  5. sortBy (NB the Underscore library uses the native JavaScript sort but feel free to use your sort algorithm!)
  6. zip
  7. sortedIndex
  8. flatten
  9. intersection
  10. difference

Advanced

  1. indexOf (again, this time with a binary search)
  2. throttle
  3. delay

Resources:

  1. The Mocha Test Framework
  2. The Chai Assertion Library
  3. Sinon - spies, stubs & mocks
  4. Underscore

About

I frequently use the lodash functional library and in order to expand my knowledge on how some of the functions work i decided to implement my own version of the functions before looking at the source code and then compare them with the lodash source code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published