什么是JavaScript语法:{Ci,CC}? [英] What is this JavaScript syntax: {Ci, CC}?
问题描述
var {Cc, Ci} = require('chrome');
只要好奇那是什么语法,是否对FF开发或其他东西是特别的。
请参阅Domenic关于什么语法称为解构赋值的解答。接下来的答案是为什么FF插件开发需要这样做。
有关于这是什么以及为什么在 http://groups.google.com/group/mozilla-labs-jetpack/browse_thread/thread / d288b79903b5b434 。
简短的回答是肯定的,它是针对Firefox附加开发的。相关的文档可以在 https://addons.mozilla.org/en-US/developers/docs/sdk/1.3/dev-guide/module-development/chrome.html 。
I'm doing some FF add-on development and I'm seeing syntax like this:
var {Cc, Ci} = require('chrome');
Just curious what that syntax is and if it's special to FF development or something else.
See Domenic's answer as to what the syntax is which is called a destructuring assignment. The answer that follows is why this is needed for FF add-on development.
There's a discussion on what this is and why it is needed at http://groups.google.com/group/mozilla-labs-jetpack/browse_thread/thread/d288b79903b5b434.
Short answer is yes, it's specific for Firefox add-on development. The relevant documentation can be found at https://addons.mozilla.org/en-US/developers/docs/sdk/1.3/dev-guide/module-development/chrome.html.
这篇关于什么是JavaScript语法:{Ci,CC}?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!