A mini clone of the Lodash library.
BEWARE: This library was published for learning purposes. It is not intended for use in production-grade software.
This project was created and published by me as part of my learnings at Lighthouse Labs.
Install it:
npm install @pkang2/lotide
Require it:
const _ = require('@pkang2/lotide/index');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
assertArraysEqual(array1,array2)
: compares array and console logs ture or falseassertEqual(actual,expected)
: compares strings and console logs true or falseassertObjectEquals(obj1,obj2)
: compares objects and console logs true or falsecountLetter(string)
: returns number of times each letter shows up in a stringcountOnly(array,element)
: returns count of element in arrayeqArrays(array1,array2)
: compares array and returns logs ture or falseeqObjects(obj1,obj2)
: compares objects and returns logs true or falsefindKey(obj,callbackfcn)
: returns key on call back functionfindKeyByValue(obj,string)
: returns key by valuehead(array1)
: returns array1[0]letterPosition(string)
: returns object with postions of lettersmap(array,callbackfcn)
: returns array with function applied to each elementmiddle(array)
: returns the middle element/s of an arraytail(array)
: returns an array without the first elementtakeUntil(array,callbackfcn)
: returns an array that terminates at specifed elementwithout(array,remove)
: returns an array with removed specified elements