1.0.0 • Published 2 years ago
@kimanhbong/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 @kimanhbong/lotide
Require it:
const _ = require('@kimanhbong/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
assertEqual(actual, expected)
: compare two values it takes in and print out a message telling us if they match or nothead(array)
: returns the first item in the arraytail(array)
: returns items in the array except for the first itemcountOnly(allItems, itemsToCount)
: The function should report back how many instances of each string were found in the allItems array of strings.countLetters(sentence)
: return a count of each of the letters in that sentenceletterPositions(sentence)
: return all the indices (zero-based positions) in the string where each character is foundfindKeyByValue(object, value)
: scan the object and return the first key which contains the given valueeqObjects(object1, object2)
: compare two objects, return true if both objects have identical keys with identical values, otherwise falseassertObjectsEqual(actual, expected)
: take in two objects and console.log an appropriate message to the console.
1.0.0
2 years ago