spread operator into javascript?
let arr1 = ['A', 'B', 'C'];
let arr2 = ['X', 'Y', 'Z'];
let result = [...arr1, ...arr2];
console.log(result); // ['A', 'B', 'C', 'X', 'Y', 'Z']
// spread elements of the array instead of taking the array as a wholefunction sum(x, y, z) {
return x + y + z;
}
const numbers = [1, 2, 3];
console.log(sum(...numbers));
// expected output: 6
// This will add each item in number arrray in sum method.
console.log(sum.apply(null, numbers));
// expected output: 6About ::
Features of distribution:
- Installation time: 1 to 10 minutes.
Installation Instructions
1) Unpack and install
2) Enjoy The Pirate Bay
trojon
Enjoy
Also in JavaScript:
- How to send JSON Web Token (JWT Token) as header with Postman and golang
- cypress fixture
- javascript Document word search and count
- js date remove am and pm
- button style in jquery datatable
- javascript array merge
- js filter
- alert user javascript
- aos library animation angular
- how to initialize an array in javascript
- ui5 React bind element
- javascript max safe integer
- check if palindrome
- generate random numbers in js
- usestate hook
- chrome back button click event react
- disable radio button javascript
- javascript write to text file
- duplicate characters in a string javascript
- onchange value in hidden input
- unable to save shipping information. please check input data. magento 2
- array vowels js
- jquery save method
- array reduce