/underscore

Primary LanguageJavaScript

Implement these Underscore.js Methods

  1. First - http://underscorejs.org/#first
  2. Last - http://underscorejs.org/#last
  3. Uniq - http://underscorejs.org/#uniq
  4. Pluck - http://underscorejs.org/#pluck
  5. Contains - http://underscorejs.org/#contains

How to tackle this assignment

  1. Fork and Clone the repo and then run npm install to make sure you pull in Chai.
  2. First, start with some research, make sure you know exactly what these five functions do before you try to implement them on your own.
  3. The "describe" and "it" blocks have been written for you, so start by writing the appropriate tests that match what is inside the "it" block.
  4. Once your tests are written, try to write a function that makes the test pass.

Bonus

Implement the function flatten - http://underscorejs.org/#flatten - you will need to use recursion to solve this.