@jasonmac123/lotidever2
v1.0.1
Published
A myriad of functions to manipulate arrays and strings to return specified elements/counting Objects/and altering arrays
Downloads
4
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 @JasonSnow123/LotideVer2
Require it:
const _ = require('@username/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array)
: finds the first element of the arraymiddle(array)
: finds the middle element of the array, if there is even number then the middle twotail(array)
: find the last element of the arrayflatten(array)
: reduces nested array elements into one single arraytakeuntil(array, condition)
: keeps adding elements from the array until condition is meetcountLetters(word)
: returns an object that contains the count for each letter in wordfindKey(object, callback)
: returns the key within an object that satisfies the callback functioncountOnly(items, condition )
: counts the items that satisfy the condition and return undefined for objects that are not foundwithout(array, removeItems)
: returns a copy of the array with items removed that satisfy the removeItems conditionmap(array, callback)
: alters each element of the array by the callback function used