1.0.0 • Published 3 years ago
@jes2806/lotide v1.0.0
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 @jes2806/lotide
Require it:
const _ = require('@jes2806/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array): returns first index of an arraytail(ourArray): returns last index of an arraymiddle(array): returns middle index of an array (it returns 2 values if the array length is even)countLetters(sentence): count how many of each letter there is in an arraycountOnly(allItems, itemsToCount): counts how many items are in itemsToCount argumenteqArrays(array1, array2): compares if two arrays are equaleqObjects(object1, object2): compares if two objects are equalfindKey(object, callback): retrieves keyfindKeyByValue(object, value): retrieves key based on value searchletterPosition(sentence): return the indices in the string where each character is foundmap(array, callback): return a new array based on the results of the callback functiontakeUntil(array, callback): returns new array stopping when value matches the value inputted in callbackwithout(source, itemsToRemove): returns a new array that removes itemsToRemove from starting array
1.0.0
3 years ago