Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Javascript
javascript sum of arguments
Catarina Martins
Programming language:
Javascript
2021-07-10 07:46:02
0
Q:
javascript sum of arguments
don magug
Code:
Javascript
2021-06-02 20:56:37
const sum = (...args) => args.reduce((a, b) => a + b); // Example sum(1, 2, 3, 4); //10
2
Tags
javascript
sum
script
Related
javascript x number of parameters
sum range javascript
js push multiple arguments
sum elements in list with same name js
javascript range of integers
sum of odd numbers in an array javascript without loop
sum of odd numbers in an array javascript
sum prime numbers javascript
to add 2 numbers using function in javascript
javascript function to add two numbers
sum all the values in an array javascript
sum of all numbers in an array javascript
first n even numbers sum javascript
javascript multiply arguments
javascript get sum array values
Write a javascript function that takes two arguments and should either sum them or just print the first one if the second one is undefined. If both are undefined print "No numbers given"
sum of two array in javascript
two sum javascript
sum all numbers in a range javascript
New to Communities?
Join the community