@rosario-je/lotide
v1.0.0
Published
A mini clone of the [Lodash](https://lodash.com) library.
Downloads
1
Readme
Lotide
A mini clone of the Lodash library.
Purpose
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.
Usage
Install it:
npm install @rosario-je/lotide
Require it:
const _ = require('@rosario-je/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertArraysEqual(arr1, arr2)
: Compares two arrays and logs a message to the consoleassertEqual(actual, expected)
: Compares two values and logs a message to the consoleassertObjectsEqual(obj1, obj2)
: Compares two objects and logs a message to the consolecountLetters(str)
: Returns an object with the count of each letter in the input stringcountOnly(allItems, itemsToCount)
: Returns an object with the count of each item in the input arrayeqArrays(arr1, arr2)
: Compares two arrays and returns a booleaneqObjects(obj1, obj2)
: Compares two objects and returns a booleanfindKey(obj, callback)
: Returns the first key for which the callback returns a truthy valuefindKeyByValue(obj, value)
: Returns the first key for which the value is foundflatten(arr)
: Returns a new array with all elements of the input arrayhead(arr)
: Returns the first element of the input arrayletterPositions(str)
: Returns an object with the position of each letter in the input stringmiddle(arr)
: Returns the middle element(s) of the input arraytail(arr)
: Returns a new array with all elements of the input array except the firsttakeUntil(arr, callback)
: Returns a new array with elements of the input array until the callback returns a truthy valuewithout(source, itemsToRemove)
: Returns a new array with all elements of the input array except the ones to remove