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('@trishnarjun/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
-
head(...)
: get the first element of the array. -
tail(...)
: get everything but the first element. -
middle(...)
: get the number or set in the middle of the array. -
assertObjectsEqual(...)
: makes sure the object equals fucntion is working right. -
countLetters(...)
: counts the number if letter in a given string -
letterPositions(...)
: gives us the indicies of a perticular letter in a string. -
map(...)
: basically an object but more primitive. -
takeUntil(...)
: printers out the array of string until a particular character is met. -
without(...)
: removes the element given to it for array. -
countOnly(...)
: counts how many times an element occurs given to it in an array. -
eqObjects(...)
: check is two objects equate. -
findKey(...)
: finds the key when given the value. -
findKeyByValue(...)
: finding the value when given the key. -
assertArraysEqual(...)
: checking is the ArrayEqual's function is workign properly. -
assertEqual(...)
: checking if the the two items given to it are equal. -
eqArrays(...)
: checking if the arrays are equal.