@klaxe/sum-of-n-numbers
v1.0.1
Published
Here is the simple function you can get from this package is
Downloads
1
Readme
Sum of n numbers Test Package
Here is the simple function you can get from this package is
const sumOfNums = (...res) => {
let sum = 0;
for (let i = 0; i < res.length; i++) {
sum += res[i];
}
return sum;
}
Usage
import the method into your project using this
import sumOfNums from '@klaxe/sum-of-n-numbers'
now you can use the sumOfNums method which returns a sum of number which is an array
const sum = sumOfNums(5, 5, 5, 5)
console.log(sum)
this will result in
console
20
Thank you
this package is my practise and I will produce more packages for the Developers
About Me
I am Murali Krishna professionally known as klaxe and here are my socials you can check out LinkedIn GitHub npm store twitter Portfolio