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 @username/lotide
const _ = require('@victorcwyu/lotide');
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
assertArraysEqual: asserts that two arrays are equal
assertEqual: asserts that two elements are equal
assertObjectsEqual: asserts that two objects are equal
countLetters: counts the letters in a sentence
countOnly: counts specific items in a collection
eqArrays: determines if two arrays are equal, returning true or false
eqObjects: determines if two objects are equal, returning true or false
findKey:takes in an object and a callback. It should scan the object and return the first key for which the callback returns a truthy value.
findKeyByValue: takes in an object and a value. It should scan the object and return the first key which contains the given value.
flatten: flattens a nested array into a single-level array
head: removes the first element from an array
map: creates a new array populated with the results of calling a provided function on every element in the calling array
middle: outputs the middle value(s) of an array
tail: removes the head of an array
takeUntil: will keep collecting items from a provided array until the callback provided returns a truthy value.
without: filters data of unwanted items