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.
npm install charles.thompson/lotide
const _ = require('charles.thompson/lotide');
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
assertArrayEquals(arr1, arr2): the first three functions are for testing assertions if the actual is equal to the expected
countLetters(str): takes in a string and counts each of the letters
countOnly(allItems,itemsToCount): return a proper report on all the strings found in the input array, and their respective counts
eqArrays(arr1, arr2): runs two arrays to see if they match
eqObjects(obj1,obj2):runs two objects to check for match
findKey(obj, callback): checks value of keys in object
findKeyByValue(obj, val): checks value and reports back key of obj
head(array): takes first index of array
letterPositions(sentence): finds placement of letters and sums together
map(arr, callback): takes first value from each part of string
middle(array): returns middle of array, sums together even array
tail(arr): returns all but 0 index of array
takeUntil(str, callback): reports back string upon unser input
without(source, ItemToRemove): removes from array with user input