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 ericguthre/lotide
Require it:
const _ = require('ericguthrie/lotide');
Call it:
const results = _.tail([1, 2, 3]) // => [2, 3]
const assertArraysEqual = _.assertArraysEqual'([1, 2, 3]) // => [1, 2, 3]): assertion passed :)
const head = _.head([1, 2, 3]) // => [1]
const middle = _.middle([1, 2, 3]) // => [2]
const assertEqual = _.assertEqual("name") // => "name": assertion passed :)
const eqArrays = _.eqArrays([1, 2, 3]) // => [1, 2, 3]
Documentation
The following functions are currently implemented:
-
function1(tail)
: removes the first value from array and leaves the tail -
function2(head)
: returns the first value of an array -
function3(middle)
: returns the middle value/s of an array -
function4(assertEqual)
: determines if values are equal -
function5(assertArraysEqual)
: determines if array values are equal -
function6(eqArrays)
: returns the equal value of the array