Destructuring
Objekte
const restaurant = {
restaurantName: 'Classico Italiano',
location: 'Via Angelo Tavanti 23, Firenze, Italy',
categories: ['Italian', 'Pizzeria', 'Vegetarian', 'Organic'],
starterMenu: ['Focaccia', 'Bruschetta', 'Garlic Bread', 'Caprese Salad'],
mainMenu: ['Pizza', 'Pasta', 'Risotto'],
openingHours: {
thu: { open: 12, close: 22 },
fri: { open: 11, close: 23 },
sat: { open: 0, close: 24 },
},
};
const { restaurantName, openingHours, categories } = restaurant;Variablennamen ändern
Standardwerte
Arrays
Elemente überspringen
Variablen vertauschen
Standardwerte
Last updated