1.0.0 • Published 4 years ago
@mvojjala/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 @mvojjala/lotide
Require it:
const _ = require('@mvojjala/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
index.js
: contains imports of all athe functionshead(arr)
: retrieves the first element in an arraytail(arr)
:retrieves other elements except headmiddle(arr)
:retrieves the middle elemnt of an arrayassertEqual(val1,val2)
: compare the two valueseqArrays(arr1,arr2)
:compare two arraysassertArraysEqual(actual,expected)
: take two arrays and gives the prints a message to consoleeqObjects(obj1,obj2)
: compare two objectsassertObjetctsEqual(actual,expected)
: take two objects to compare and print a messgae to consolecountOnly(array,object)
: returns an object containing counts of everything that input object listedcountLetters(string)
: returns a count of each of letters in a stringfindKeyByValue(object)
:scan the object and returns first key which contains the given valueflatten(array)
: flattens the nested arrays
1.0.0
4 years ago