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 @fatbobot/lotide
Require it:
const _ = require('@fatbobot/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
function1(assertArraysEqual)
: prints an assertion if two array inputs are equalfunction2(assertEqual)
: returns true or false if two values are equalfunction3(assertObjectsEqual)
: prints an assertion if two objects are equalfunction4(countLetters)
: returns a number representing how many non space characters are in a stringfunction5(countOnly)
: returns a count of how many of the same value are in an inputfunction6(eqArrays)
: compares two arrays and returns true or false if equalfunction7(eqObjects)
: compares two objects and returns true or false if equalfunction8(findKey)
: receives an object and callback. returns the value associated with key in callbackfunction9(findKeyByValue)
: receives object and value. Returns key associated with valuefunction10(flatten)
: receives array. removes and merges nested arrays in umbrella arrayfunction11(head)
: receives array. returns first value in arrayfunction12(letterPositions)
: return all the indices (zero-based positions) in the string where each character is found.function13(middle)
: receives array. returns middle values. 1 if odd, 2 if even length arrayfunction14(tail)
: receives array. returns all values in array after first positionfunction15(head)
: receives array and callback. Returns all values up until specified value in callbackfunction16(without)
: receives two arrays. returns array without values in second arrayfunction17(map)
: receives an array and a callback. Function maps and applies callback to individual values in arrayfunction17(takeUntil)
: receives an array and a callback. Function pushes array values into new array until it reaches a value specified in callback function