<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>js 立即执行函数定义方法</title>
</head>
<body>
<script type="text/javascript">
//方法一
(function(){})(3);
//方法二
(function(){}(3));
//方法三
+function(){}(3);
-function(){}(3);
!function(){}(3);
~function(){}(3);
</script>
</body>
</html>