@webtech.pmp/lotide
v1.1.0
Published
A clone of the Lodash JS library to practice creating various types of functions using JS
Downloads
19
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 @webtech.pmp/lotide
Require it:
const _ = require('@webtech.pmp/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
head(...)
: a function that returns the first item in the array.tail(...)
: a function that returns the "tail" of an array: everything except for the first item (head) of the provided array.middle(...)
: a function that takes in an array and return the middle-most element(s) of the given array.eqArray(...)
: a function that takes in two arrays and returns true or false, based on a perfect match.assertEqual(...)
: a function that compares the two values it takes in and print out a message telling us if they match or not.eqArraysTest(...)
: a test function that can compare two arrays for a perfect matchassertEqualTest(...)
: a test function that can compare two arrays for a perfect matchassertArraysEqualTest(...)
: a test function that can compare two arrays for a perfect match