以下 CoffeeScript:greet = -> "This is an example of a function"編譯時生成以下 JavaScript 代碼:(function() { var greet; greet = function() { return "This is an example of a function"; };}).call(this);我的問題是,為什么 JavaScript 不創建像這樣的單個函數:(var greet = function() { return "This is an example of a function"};}).call(this);
在 CoffeeScript / JS 中將函數分配給 vars
Qyouu
2022-12-09 15:34:50