1.0.0 • Published 4 years ago
@henrymao/lotide v1.0.0
This project was created and published by me as part of my learnings at Lighthouse Labs.
Usage
Install it:
npm install @henrymao/lotide
Require it:
const _ = require('@henrymao/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(...)
: descriptionfunction2(...)
: descriptionfunction3(...)
: descriptionassertArraysEqual(arr1, arr2)
: self-explanatoryhead(arr)
: finds the first element of an arraytails(arr)
: returns everything but the first itemmiddle(arr)
: returns the middle element of the arrayassertEqual(val1, val2)
: as the name suggestsassertObjectsEqual(obj1, obj2)
: checks whether two objects are equalcountLetters(str)
: count the number of letters in a stringcountOnly(arr,obj)
: returns an new object that the original object finds in the arrayeqArrays(arr1, arr2)
: compare two arrayseqObjects
: compare two objectsfindKey(obj,callback)
: finds the first key that callback returns truefindKeyByValue(arr, val)
: finds the key of an array with the given valueletterPositions(str)
: finds the position of the given letter in a stringmap(arr,callback)
: returns a new array according to the callback functiontakeUntil
: keep collecting values until the callback returns truewithout(arr, banned)
: return the array without banned items
1.0.0
4 years ago