largest-element
v1.0.1
Published
A JavaScript Package for finding the largest element of an array.
Downloads
2
Maintainers
Readme
largest-element
A JavaScript Package for finding the largest element of an array.
Features
npm
Install
npm install --save largest-element
Script Tag
For Development
<script src="https://rawgit.com/Prosen-Ghosh/largest-element/master/largest.js"></script>
For Production
<script src="https://cdn.rawgit.com/Prosen-Ghosh/largest-element/98a44f04/largest.js"></script>
Usage
const large = require('largest-element');
large([1,2,10,1,2,3,{},[]]);
//=> 10
large([1,2,10,1,2,3,{}]);
//=> 10
large([1,2,101,10,2,3]);
//=> 101
large([]);
//=> null
large([1]);
//=> 1
large([-11,-1]);
//=> -1
large(); // without parameter this function will return a type error
//=> TypeError: largest() expects an array parameter
Author
Prosen Ghosh [email protected] (https://bd.linkedin.com/in/prosen-ghosh-baba9aa8)
License
- MIT