What does curly brackets in the `var { … } = …` statements do?
问题 Not sure if this is a Mozilla-specific JS syntax, but I often found variables being declared this way, for example, in add-on SDK docs: var { Hotkey } = require("sdk/hotkeys"); and in various chrome Javascript ( let statement is being used in place of var ), let { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components; I found it very confusing but I am not being able to find any documentation about both syntax, even on MDN. 回答1: They're both JavaScript 1.7 features. The first one