<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
(function(x, y){
console.log(x + y)
})(1, 2);
// 第一种写法:
// (function(){})();
// 第二种写法:
// (function(){}());
(function(x, y){
console.log(x + y)
}(2, 3));
</script>
</body>
</html>
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交