Home  >  Article  >  Web Front-end  >  Introduction to javascript special usage examples_jquery

Introduction to javascript special usage examples_jquery

WBOY
WBOYOriginal
2016-05-16 17:11:271077browse

Syntax 1:

Copy code The code is as follows:

function sayWhat(msg){
alert(msg);
}
sayWhat("Hello");

is equivalent to the following syntax (js closure (anonymous self-executing function) syntax):
Copy code The code is as follows:

(function(msg){
alert(msg);
})("Hello");
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn