当前位置:网站首页>Two declaration methods of functions of JS
Two declaration methods of functions of JS
2022-04-23 09:22:00 【Small white egg tart】
Catalog
The first is to use function keywords to customize functions ( Name the function )
The second function expression ( Anonymous functions )
The first is to use function keywords to customize functions ( Name the function )
The format is as follows :
function Function name (){
}
Invocation time fn();
function fn() {
}
The second function expression ( Anonymous functions )
The format is as follows :
var Variable name = function(){
}
Different from defining variables , What is stored in the definition variable is the variable , What is stored in this is the function .
It's also called fun(), Parameters can also be passed in parentheses .
var fun = function(arr, arr1) {
// console.log(arguments[1]);
console.log(arr);
console.log(arr1);
}
版权声明
本文为[Small white egg tart]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230624114368.html
边栏推荐
- Mini - exercice MySQL (seulement pour les débutants, pas pour les non - débutants)
- The crawler returns null when parsing with XPath. The reason why the crawler cannot get the corresponding element and the solution
- Go language learning notes - exception handling | go language from scratch
- Number theory to find the sum of factors of a ^ B (A and B are 1e12 levels)
- Employee probation application (Luzhou Laojiao)
- Give the method of instantiating the object to the new object
- Withholding agent
- Go language learning notes - language interface | go language from scratch
- [SQL Server fast track] view and cursor of database
- Harbor enterprise image management system
猜你喜欢

First principle mind map

To remember the composition ~ the pre order traversal of binary tree

Write down the post order traversal of the ~ binary tree

Mini - exercice MySQL (seulement pour les débutants, pas pour les non - débutants)

Kettle实验 (三)

《数字电子技术基础》3.1 门电路概述、3.2 半导体二极管门电路

搞不懂时间、时间戳、时区,快来看这篇

MySQL小练习(仅适合初学者,非初学者勿进)

Applet error: should have URL attribute when using navigateto, redirectto or switchtab
![[58] length of the last word [leetcode]](/img/c5/3ba1fe5a81593d9576bb597f0d5f45.png)
[58] length of the last word [leetcode]
随机推荐
Group Backpack
The most concerned occupations after 00: civil servants ranked second. What was the first?
EmuElec 编译总结
Data visualization: use Excel to make radar chart
Number theory to find the sum of factors of a ^ B (A and B are 1e12 levels)
How does kubernetes use harbor to pull private images
Operation not allowed for a result set of type resultset TYPE_ FORWARD_ ONLY. Explain in detail
MySQL - Chapter 1 (data types in MySQL)
Wechat applet catchtap = "todetail" event problem
资源打包关系依赖树
Principle of synchronized implementation
112. 路径总和
ALV树(LL LR RL RR)插入删除
tsdf +mvs
LeetCode_ DFS_ Medium_ 1254. Count the number of closed islands
Four pictures to understand some basic usage of Matplotlib
kettle庖丁解牛第14篇之JSON输入
小程序报错 :should have url attribute when using navigateTo, redirectTo or switchTab
Leetcode-199 - right view of binary tree
Pctp test experience sharing