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 @Rheaazarraga/lotide
Require it:
const _ = require('@Rheaazarraga/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
assertEqual
: compares two values to see whether or not they're equal, and prints either a passed or failed assertion messageassertArraysEqual
: compares two arrays to see whether or not they're equal, and prints either a passed or failed assertion messageassertObjectsEqual
: compares two objects to see whether or not they're equal, and returns either a passed or failed assertioncountLetters
: returns the number count of letters in a given stringcountOnly
: returns counts for a specific subset of given items in an objecteqArrays
: compares two arrays and returns true or false based on a perfect matcheqObjects
: compares two objects and returns true or false, based on a perfect matchfindKey
: returns the first key for which the callback returns a truthy valuefindKeyByValue
: takes in an object and a value. It should scan the object and return the first key which contains the given value. If no key with that given value is found, then it should return undefinedhead
: returns the first item in a given arraymiddle
: takes in an array and returns the middle-most elements of the given arraytail
: returns the rest of the elements in an array after the headindex
: a list of all of the functions in an objectletterPositions
: returns all indices in the string where each character is foundmap
: returns a new array based on the results of the callback functiontakeUntil
: returns a "slice of the array with elements taken from the beginning"without
: removes elements from an array