@010jgl/lotide
v1.0.0
Published
lotide functions, lhl bootcamp
Downloads
7
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 @010jgl/lotide
Require it:
const _ = require('@010jgl/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(...)
: descriptionfunction2(...)
: descriptionfunction3(...)
: descriptionhead(array)
: Function to return the first item in the array.tail(array)
: Function to return the last item of the array.middle(array)
: Takes in an array, returns the middle most elementsassertArraysEqual(actual, expected)
: Compares 2 arrays to see if they are identicaleqArrays(a, b, c)
: Compares 2 arrays to see if they are equalassertEqual(actual, expected)
: Compares 2 value to see if equalassertObjectsEqual(actual, expected)
: Compares 2 objects to see if they are equalcountLetters(str)
Count letters in a stringcountOnly(allItems, itemsToCount)
: Only counts the input in an arrayeqObjects(object1, object2)
: Compares 2 objects to see if they are identicalfindKey(obj, callback)
: Returns the key of a value we callbackfindKeyByValue(object, value)
: Finds the key of a specific valueletterPositions(sentence)
: Returns the position of a specific lettermap(array, callback)
: Takes in an array and return a new array with the callback wantedtakeUntil(array, callback)
: Takes in an array and return a new array with with the callback valueswithout(array, itemsToRemove)
: Takes in an array without the items to remove