const restaurant = {
name: "Classico Italiano",
location: "Via Angelo Tavanti 23, Firenze, Italy",
categories:["Italian", "Pizzeria","Vegetarian", "Organic"],
startMenu: ["Focaccia", "Bruschetta", "Garlic Bread", "Caprese Salad"],
mainMenu: ["Pizza", "Pasta", "Risotto"],
openingHours: {
thur: {
open: 12,
close:22
},
fri: {
open: 11,
close: 23
},
sat: {
open: 0, //Open 24 hours
close: 24,
},
},
order: function (starterIndex, mainIndex){
return [this.startMenu[starterIndex], this.mainMenu[mainIndex]]
}
}
i am trying to destructure the name, location and opening hours like this
const {name, location, categories} = restaurant;
console.log(name, location, categories);
but i am getting the below error
Uncaught SyntaxError: Identifier 'location' has already been declared (at script.js:1:1)
i am guessing it is because location is a keyword in javascript.
Please i need help with this