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 @dango3010/lotide
Require it:
const _ = require('@dango3010/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
head
: prints out the first element of an arraytail
: prints out the other elements of an arraymiddle
: prints out the middle elements of an arrayassertArraysEqual
: compares two arrayseqArrays
: compares two arraysassertEqual
: compares two arraysassertObjectsEqual
: compares two objectseqObjects
: compares two objectscountLetters
: counts the frequency of each letter in a stringcountOnly
: counts the frequency of the requeted words in an arrayfindKey
: output the key that have a particular key value from an objectfindKeyByValue
: find key that has a specific key value from an objectflatten
: prints out one arayletterPositions
: find a position of a letter in a stringmap
: prints out the first letter of each word in an arraymode
: prints out the # that has the most frequencytakeUntil
: prints out the array of positive numberswithout
: prints out an array excluding one specific word