@neavy/lotide v1.0.0
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 @neavy/lotide
Require it:
const_ = require('@neavy/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head : retrieve first element of an array tail : retrieve every element of the array except the first one middle : return the middle-most element(s) of an array assertArraysEqual: compare two arrays and prints out a pass or fail message assertEqual : compare two values and prints out a pass or fail message assertObjectsEqual : compare two objects and prints out a pass or fail message countLetters : count how many times a letter appears in a given string countOnly : count how many times a given string appears in an object eqArrays : compare two arrays eqObjects : compare two objects findKeyByValue : find a key in an object by value findKeys : return the first key in an object that proves truthy based on the callback function letterPositions : return all the indices in a string where each character is found map : my own versionv of the map function takeUntil : take and return a slice of a given array with elements taken before the second argument without : removes a given element from an array
2 years ago