Skip to content
This repository has been archived by the owner on Nov 2, 2019. It is now read-only.

Prosen-Ghosh/smallest-element

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smallest-element

A JavaScript Package for finding the smallest element of an array.

npm license github-issues

nodei.co

travis-status stars forks

Features

npm Install

npm install --save smallest-element

Scripts Tag

For Development

<script src="https://rawgit.com/Prosen-Ghosh/smallest-element/master/smallest.js"></script>

For Production

<script src="https://cdn.rawgit.com/Prosen-Ghosh/smallest-element/9406abf2/smallest.js"></script>

Usage

const small = require('smallest-element');

small([1,2,3,-10]);
//=> -10

small([1,2,3,-10,{}]);
//=> -10

small([1,2,3,-10,-100,[]]);
//=> -100

small([]);
//=> null

small(); //withour parameter this function will throw a type error
//=> TypeError: smallest() expects an array parameter

Author

Prosen Ghosh prosenghosh25@gmail.com (https://bd.linkedin.com/in/prosen-ghosh-baba9aa8)

License

  • MIT

About

A JavaScript Package for finding the smallest element of an array.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published