Do we have to always use {} when creating a variable through destructuring?

I have a question regarding nested objects. After creating any object, let’s say we have an object from the example that Codecademy gives us in the lecture “Destructured Assignment”.

const vampire = {
  name: 'Dracula',
  residence: 'Transylvania',
  preferences: {
    day: 'stay inside',
    night: 'satisfy appetite'
  }
};

why there is no semicolon after closing bracket of nested object “Preferences”?

It surely is out of scope for the subject, but For who like me wonder why the last comma doesn’t throw any error… Here’s what I found for answer:

JavaScript is flexible with the syntax for object literals, and it allows for a trailing comma after the last property-value pair. This is known as the Trailing Comma or Commas After the Last Item. This feature was introduced to make it easier to add, remove, or rearrange items without having to worry about adding or removing commas after the last element.

In JavaScript, the semicolon is used to terminate statements. However, object literals, such as the one in your example (vampire), are not considered standalone statements. Instead, they are expressions that define an object.

When defining an object literal, you separate key-value pairs with commas. The syntax { key1: value1, key2: value2 } defines an object with two properties. The object literal itself doesn’t require a semicolon at the end because it’s not a standalone statement; it’s part of the larger JavaScript syntax.