gpt4 book ai didi

javascript - 在 javascript 中全局导入

转载 作者:行者123 更新时间:2023-12-03 10:05:32 27 4
gpt4 key购买 nike

有人可以向我解释一下这在 javascript 中的作用吗?

 (function (x,y){}(x,y));

或者这个

  // global import
(function ($, YAHOO) {
// now have access to globals jQuery (as $) and YAHOO in this code
}(jQuery, YAHOO));

我从未在其他语言(如 java 或 c++)中看到过类似的东西

最佳答案

function(x, y) { } 是一个匿名函数。

(x, y) 调用该函数,将 xy 作为参数传递。

关于javascript - 在 javascript 中全局导入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11285807/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com