Lowbar
Notes
I have combined two Northcoders sprints, Lowbar and Advanced Lowbar, into one repository. These sprints involved implementing Underscore functions with pure JavaScript, and testing them in Mocha and Chai.
To test these functions, after cloning this repository from the terminal with
$ git clone <REPO_NAME>
Simply enter again in the terminal these commands.
$ npm install
then after the dependencies have been installed, enter
$ npm test
Goals
- Continue practicing test-driven development (TDD) - both the process and the
tools you'll be using to do it from now until the end of the course (and beyond).
- Get an 'inside view' of one of the most heavily used JavaScript libraries
underscore (11m downloads on NPM last month) and
get used to reading its API documentation.
- Become accustomed to using NPM to find and install
JS libraries
- Learn to effectively pair program and use Git/Github as a collaboration tool.
- Lay the foundations for understanding the functional style of programming that JS lends itself so well to.
Tasks
The Lowbar Sprint involves reimplementing a JS library as if I were its author. For Part 1 of this sprint , I need to reimplement the following methods:
Core
These are the core functions I have implamented;
- identity
- first
- last
- each
- indexOf
- filter
- reject
- uniq
- map
- contains
- pluck
- reduce
- every
- some
- extends
- defaults
Advanced
- once
- memoize
- shuffle
- invoke
- sortBy
- zip
- sortedIndex
- flatten
- intersection
- difference
- indexOf (again, this time with a binary search)