Home  >  Article  >  Web Front-end  >  Basic explanation of JavaScript functions

Basic explanation of JavaScript functions

巴扎黑
巴扎黑Original
2017-07-19 14:38:551024browse

Definition of function 1. Function declaration function function name () { } 2. Function expression var aa=function(){ } function call 1. Function name () Function classification: Method 1: Named functions Anonymous function (Anonymous function cannot be called directly. If you want to call it, you need to use self-calling of the anonymous function)                     ( function(){                                     alert();                                 })(); Method 2: ​​​​​​​Built-in functions: Officially provided ​ ​ ​ ​ ​ Custom function Function parameters (formal parameters actual parameters) Parameters are in one-to-one correspondence Actual parameters > Formal parameters -- redundant actual parameters are omitted Actual parameters

The above is the detailed content of Basic explanation of JavaScript functions. For more information, please follow other related articles on the PHP Chinese website!

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