Skip to content

arsangamal/forlist

Repository files navigation

Forlist

A javascript library for array operations.

Installation

npm i forlist

Available functions

nthElement(index)

get the nth element of an array
    var nums = [1, 2, 3, 4];
    var number = nums.nthElement(2); // 3

Available properties

Array.prototype.firstElement

get the first element from an array
    var nums = [1, 2, 3, 4];
    var number = nums.firstElement; // 1

Array.prototype.lastElement

get the last element from an array
    var nums = [1, 2, 3, 4];
    var number = nums.lastElement; // 4

More is yet to come ;) ..

Test

npm run test

About

A javascript library for array operations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published