1.0.0 • Published 2 years ago
@vvynz/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 @vvynz/lotide
Require it:
const _ = require('@vvynz/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
Documentation
The following functions are currently implemented:
function1(head)
: Returns the first element in an arrayfunction2(tail)
: Returns the all the elements after the first element in an arrayfunction3(middle)
: Returns the middle element in an array. If the array has an odd number of elements, it'll return 1 element. If the array has an even number of elements, it'll return 2 elements.function3(assertEqual)
: Takes in 2 parameters and console logs an assertion message depending if they are strictly equal or not.function3(assertArraysEqual)
: Takes in 2 arrays and compares if the arrays are equal and console logs an assertion message depending if they are strictly equal or not.function3(eqArrays)
: Takes in 2 arrays and compares if the arrays are equal and returns a truthy or falsy value.
1.0.0
2 years ago