@shurenkai/lotide
v1.0.0
Published
created for a LHL project, these are functions that will help track your everyday array, string, and object basics!
Downloads
3
Readme
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 @shurenkai/lotide
Require it:
const lotide = require('@shurenkai/lotide');
Call it:
const results = lotide.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
eqArrays(arr1, arr2)
: will compare to see if 2 arrays are exactly the same or not (arr1 === arr2)assertEquals(actual, expected)
: will return a string that states whether or not 2 outputs are the sameassertArrayEquals(arr1, arr2)
: will return confirmation to see if 2 arrays are exactly the same or noteqObjects(obj1, obj2)
: will compare to see if 2 objects are the same or notassertObjectsEqual
: will return confirmation to see if 2 objects are the same or notcountLetters(str)
: will return the number of letters that are in a stringletterPositions(sentence)
: will return what positions in an array letters are incountOnly(allItems, itemsToCount)
: will count chosen items from an arrayfindKey(obj, callback)
: will use a callback function to find certain keys in an objectfindKeyByValue(obj, input)
: will find key in an object based on user inputmap(array, callback)
: will take a callback function to find items in an arrayhead(arr)
: will return the head of an array (only return first value of array)tail(arr)
: will return an array without the first value (the head)middle(arr)
: will find the middle item(s) of an array