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 @CamilaRivera/lotide
Require it:
const _ = require('@CamilaRivera/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
The following functions are currently implemented:
middle(array)
: return the middle element of an arraytail(array)
: return an array with all the elements except the fist elementhead(array)
: return the first element of an arrayassertArraysEqual(array1, array2)
: if two arrays are equal print a true message else print a false messageassertEqual(element1, element2)
: prints out if two elements are the sameflatten(upToOneNestedArray)
: receive an up to one grade nested array and returns a single arraycountOnly(array, object)
: return the first element of an arrayeqArray(array1, array2)
: check if two arrays are equal and return a booleanassertArraysEqual(array1, array2)
: compares two arrays and prints if they are equal or differenteqObject(object1, object2)
: check if two objects are equal and return a booleanfindKeyByValue(object, valueOfSearchedKey)
: check if the searched value exists in the object and if it does retunr the key