本文介绍了Javascript!函数声明语法做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞!我遇到了一个函数定义风格在浏览Emile动画库时是新的:I ran across a function definition style that is new to me while browsing the Emile animation library:!function () { // do something}();我很熟悉: 函数表达式: var foo = function(){} 命名函数表达式: var foo = function bar(){} 函数声明: function foo(){} 立即函数: var foo = function(){}()或 var foo = (){})()Function expressions: var foo = function (){}Named function expressions: var foo = function bar(){}Function declarations: function foo(){}Immediate functions: var foo = function (){}() or var foo = (function (){})()上面的代码段使用立即函数调用假设),但是!是什么让我失望。 JSLint很高兴,所以它必须是犹太教。The snippet above uses immediate function invocation (for variable scoping, I assume), but the ! is what's throwing me off. JSLint is happy with it, so it must be kosher. What does it do?推荐答案在档案中找到: StackOverflow.com - 感叹号在函数之前做了什么? 这篇关于Javascript!函数声明语法做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-21 19:05