// Basic
const favorites = ["Seafood", "Salad", "Nugget", "Soup"];
console.log(...favorites);
/* Math.max() -> Mencari nilai terbesar */
const numbers = [12, 32, 90, 12, 32];
// Sama seperti kita menuliskan
// console.log(Math.max(numbers[0], numbers[1], numbers[2], numbers[3])
console.log(Math.max(...numbers));
/* output
90
*/
// Spread Operator Array Concat
const favorites = ["Seafood", "Salad", "Nugget", "Soup"];
const others = ["Cake", "Pie", "Donut"];
const allFavorites = [...favorites, ...others]
console.log(allFavorites);
/* output:
[ 'Seafood', 'Salad', 'Nugget', 'Soup', 'Cake', 'Pie', 'Donut' ]
*/