1.0.0 • Published 6 years ago
@mhfernnn/lotide_pair 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 Maria Fernandez and Jordan Owens as part of our learning at Lighthouse Labs.
Usage
Install it:
npm install @mariahfernnn/lotide_pair
Require it:
const _ = require('@username/lotide_pair');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(array)
: returns first index of the arraytail(array)
: removes the first index and returns the rest of the arraymiddle(array)
: returns the middle value of an arraymap(array, callback)
: returns a new array "based on the results of a callback function"takeUntil(array, callback)
: returns a "slice of the array with elements taken from the beginning"findKeys(obj, callback)
: returns a truthy value or undefinedfindKeyByValue(obj, value)
: returns the first key which contains the given value; returns undefined if no key with that given value is foundeqObjects(obj1, obj2)
: returns true or falseeqArrays(arr1, arr2)
: returns true if they are equalassertArraysEqual(actual, expected)
: compares actual to expected, returns true/falseassertEqual(actual, expected)
: compares actual to expected, returns true/false
1.0.0
6 years ago