rest arguments javascript
function sum(...numbers) {
return numbers.reduce((accumulator, current) => {
return accumulator += current;
});
};
sum(1,2) // 3
sum(1,2,3,4,5) // 15
Also in JavaScript:
- generate random ip address javascript
- axios Cross origin http://localhost forbidden
- local storage javascript array
- javascript to detect browser
- javascript remover acentos
- console log nested objects js
- namesandroles javascript
- object keys javascript
- import { PartialType } from '@nestjs/mapped-types'
- vuejs remove object from array
- clear terminal node js
- javascript push item to beginning of array
- moment js year only
- loop through json array python
- disable radio button javascript
- pipe of date angular
- get the location of an item in an array
- javascript select element with two classes
- js alert and redirect
- js prompt
- document.addEventListener("backbutton
- javascript settimeout loop
- pass php variable to javascript
- angular copy