Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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"]
Add Comment
Please, Sign In to add comment