1.0.2 • Published 3 years ago
@austinkret/lotide v1.0.2
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 @username/lotide
Require it:
const _ = require('@austinkret/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(arr)
: Takes an array and returns the first index.tail(arr)
: Takes an array and returns a new array where the first element has been removed.middle(arr)
: takes an array and returns the middle index of the array. If the array is even it returns the two middle index's.flatten(arr)
: flatten nested arrays into a single arrays.countOnly(arr)
: Count the number of times a name appears in a list, but only the specified names.letterPositions(arr)
: return the index positions of a letter in a word.findKeyByValue(arr)
: find the key of a value based on the object.eqObjects(arr)
: determine if two objects are equal.eqArrays(arr)
: determine if two arrays are equal.