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

A JavaScript Package for calculating average from an array. Also it will work for non-number array and it will ignore the non-numbers.

License

Notifications You must be signed in to change notification settings

Prosen-Ghosh/average-array

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

average-array

A JavaScript Package for calculating average from an array. Also it will work for non-number array and it will ignore the non-numbers.

npm license github-issues

nodei.co

travis-status stars forks

Features

npm Install

npm install --save average-array

Script Tag

For Development

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

For Production

<script src="https://cdn.rawgit.com/Prosen-Ghosh/average-array/6dac0302/average.js"></script>

Usage

const avg = require('average-array');

avg([]);
//=> null

avg([1]);
//=> 1

avg([1,[]]);
//=> 1

avg([1,[],2]);
//=> 1.5

avg([1,2,3,4,5])
//=> 3

avg(); // without parameter this function will throw a type error
//=> TypeError: average() 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 calculating average from an array. Also it will work for non-number array and it will ignore the non-numbers.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published