Questions tagged «javascript-1.7»

4
var {…} =…语句中的花括号有什么作用?
不知道这是否是Mozilla特定的JS语法,但是我经常发现以这种方式声明变量,例如,在附加SDK docs中: var { Hotkey } = require("sdk/hotkeys"); 并在各种Chrome Javascript中(let用代替var), let { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components; 我发现这很令人困惑,但是即使在MDN上,我也找不到有关这两种语法的任何文档。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.