Created
May 20, 2018 10:51
-
-
Save valerymelou/b668523bf0d9889fdf82d000407ee0c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example 1 | |
const books = ["Don Quixote", "The Hobbit", "Alice in Wonderland", "Tale of Two Cities"]; | |
console.log(...books); // Don Quixote The Hobbit Alice in Wonderland Tale of Two Cities | |
// Example 2 | |
const primes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]; | |
console.log(...primes); // 2 3 5 7 11 13 17 19 23 29 | |
// Example 3 | |
const fruits = ["apples", "bananas", "pears"]; | |
const vegetables = ["corn", "potatoes", "carrots"]; | |
const produce = [...fruits, ...vegetables]; | |
console.log(produce); // ["apples", "bananas", "pears", "corn", "potatoes", "carrots"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment