0
const restaurant = {
    name: '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'],};
// Optional Chaining (?.) ///
if (restaurant.openingHours && restaurant.openingHours.mon)
    console.log(restaurant.openingHours.mon.open);
// With optional chaining
console.log(restaurant.openingHours.mon ? .open); /`// To this line Where Optional Chaining (?.) is spresent, there spase automaticly coming. IDK how..`.

``The error showing me is "Uncaught SyntaxError: Unexpected token '.' "`

  • 1
    Does this answer your question? [eslint - Optional chaining error with vscode](https://stackoverflow.com/questions/61628947/eslint-optional-chaining-error-with-vscode) – Daniel Beck Oct 28 '22 at 18:31

0 Answers0