const products = ['Milk', 'Coffee', 'Sugar', 'Honey', 'Apple', 'Carrot'] console.log(products.sort()) // ['Apple', 'Carrot', 'Coffee', 'Honey', 'Milk', 'Sugar'] //Now the original products array is also sorted
const products = ['Milk', 'Coffee', 'Sugar', 'Honey', 'Apple', 'Carrot'] console.log(products.sort()) // ['Apple', 'Carrot', 'Coffee', 'Honey', 'Milk', 'Sugar'] //Now the original products array is also sorted