My implementation of JavaScript's Underscore library.
You will find the following methods in the lowbar.js file.
- identity
- values
- first
- last
- each
- indexOf
- filter
- reject
- uniq
- map
- contains
- pluck
- reduce
- every
- some
- extends
- defaults
- once
- negate
- shuffle
- invoke
- sortBy
- zip
- sortedIndex
- flatten
- intersection
- difference
- memoize
- delay
- where
- throttle
- partial
Built using Node.js v8.6.0 and then used Chai v3.5.0 and Mocha v.3.5.0 for test driven development. I also used Sinon v4.2.1 to mock console logs.
If you would like to use this underscore library in your code, open the terminal window, close this repo, and execute
$ npm install
You can then copy the lowbar.js file into your working files and require it in using
$ const _ = require('./lowbar.js');
Making sure to check the path.
You can then start using the functions as follows
_.identity('hello world')
To run the tests in the mocha test environment
$ npm test
- Kerry Godsmark - Kerry
- Northcoders coding bootcamp