Skip to content

vvEii/lotide

Repository files navigation

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 @vvei/lotide

Require it:

const _ = require('@vvei/lotide');

Call it:

const results = _.tail([1, 2, 3]) // => [2, 3]

Documentation

The following functions are currently implemented:

  • head(array): return the first element in the array
  • middle(array):return the middle element of the array if the array is odd, and return the two middle elements if the array is even
  • tail(array): return the last element in the array
  • eqArrays(array1, array2): return true if the two passed arrays are equal; otherwise, return false
  • eqObjects(object1, object2): return true if the two passed objects are equal; otherwise, return false
  • countOnly(array,object): return an object contains the name and the number of ocurrences in the array, depends on the object passed in indicated if count the name or not
  • flatten(array): return an one-level array of the passed nested array

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published