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 mustafa200/lotide
Require it:
const _ = require('mustafa200/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
head
: returns the first element of an arraytail
: returns the last element of an arraymiddle
: returns the middle element of an arrayassertArraysEqual
: a function to compare two arrays with an assertionassertEqual
: a function to compare two primitives with an assertionassertObjectsEqual
: a function to compare two objectscountLetters
: returns the count of the occurence of letters in a stringcountOnly
: counts the elemnts of an array or an objecteqArrays
: to compare two arrayseqObjects
:to compare two objectsfindKey
: returns the key of an objectfindKeyByValue
: returns a key in an object by looking its valueletterPositions
: returns the position of each letter in a giving stringmap
: maps an array into a new onetakeUntil
; Returns elemnts of an arry until a giving valuewithout
; Returns an array with unwanted elemnts removed .
LHL Lotide