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 @keyvanzz/lotide
Require it:
const _ = require('@keyvanzz/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
function1(assertArrayEqual)
: performs an assertion of arrays to determine if they are equal.function2(assertEqual)
: performs an assertion of two values to determine if they’re equalfunction3(assertObjectsEqual)
: performs an assertion to determine if two objects are equalfunction4(countLetters)
: counts individual letters and displays totals of eachfunction5(countOnly)
: performs a search for given names and tallies each occurance of given names in an arrayfunction6(eqArrays)
: determines if arrays are equal in their valuefunction7(eqObjects)
: determines if objects are equal in their valuefunction8(findKey)
: performs a search for a given value of an object key nested inside of another object and returns it’s parent keyfunction9(findKeyByValue)
: scans object for a value and displays a genre based on whether the given show matches the genre.function10(flatten)
: condenses several arrays into one arrayfunction11(head)
: displays first object of arrayfunction12(letterPositions)
: determines where a given letter occurs in a stringfunction13(map)
: shows character total value of a given string in an array. will individually print values of each string in array.function14(middle)
: will display undefined if array is 1 or 2 index long. will display middle 1 value if array is odd length. will display 2 center values if array is even length.function15(tail)
: removes first item of array and displays remaining values in a new arrayfunction16(takeUntil)
: scans an array until it reaches the given value and displays data until reaching said value.function17(without)
: will return a subset of a given array, removing unwanted elements