Variable declaration with "{}" in JavaScript

October 29, 2019

I saw a code I don't know like "const { props } = this". What is "{}" mean?

It is one of syntax in “destructuring assignment” in JavaScript ES6.

For example

You can rewrite this.

const title = post.title
const date =
const tags = post.tags

As this.

const { title, date, tags } = post

© 2021 CXSMXS, An essay by a Korean developer living in Japan