Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/392.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 什么是((窗口)=>;{…})(窗口);意思_Javascript - Fatal编程技术网

Javascript 什么是((窗口)=>;{…})(窗口);意思

Javascript 什么是((窗口)=>;{…})(窗口);意思,javascript,Javascript,项目中的I文件包含以下代码: //begin of the file ((window) => { 'use strict'; class View extends GSM.EventEmitter { constructor() { super(); //some function here } })(window); //end of the file 这个结构意味着什么 这一行是什么意思?((窗口)=>{}(窗口); constructor

项目中的I文件包含以下代码:

 //begin of the file
 ((window) => {
    'use strict';
class View extends GSM.EventEmitter {

    constructor() {
        super();
//some function here

}
})(window);
//end of the file
  • 这个结构意味着什么
  • 这一行是什么意思?
    ((窗口)=>{}(窗口);
  • constructor()
    是什么意思

我的英语有点差,希望我把问题说清楚。:-

es6箭头功能,了解更多细节

和阶级

这是写在ES6上的模块模式。它允许您将变量分组在同一范围内,并将它们与其他“模块”隔离

你可以找到更详细的答案


构造函数
函数允许您初始化类实例

我的回答有用吗?还是你需要更多信息???
(function(/* your deps */){
  //your code
  var privateVariable;
}(/* your dependencies */))