当前位置:网站首页>js函数相关的复习
js函数相关的复习
2022-06-29 22:19:00 【慎思笃行_】
1.构造函数(这个构造函数在开发的时候是很少使用的)
var fun =new Function('console.log("这是我的第一个函数");');
fun();
2.声明函数
function fun2(){
console.log(‘这是我的第二个函数 ——————’)
}
console.log(fun2)
3.函数表达式
var fun3=function(){
console.log('我是匿名函数中封装的代码');
}
fun3() //调用该函数
然后我们尝试给函数传入参数 我们这边该如何传值呢?
function sum (a,b){
console.log(a+b);
}
sum(1,2)
小提示:return后面的提示都不会执行 / return后面不跟值 那么他会输出undefined
边栏推荐
猜你喜欢
Guangzhou launched a campaign to promote the safety of bottled gas and popularized the knowledge of gas safety
每日刷题记录 (八)
2022年第一季度保险服务数字化跟踪分析
Detailed description of gaussdb (DWS) complex and diverse resource load management methods
26 years old, 0 basic career change software test, from 3K to 16K monthly salary, a super complete learning guide compiled by me
详细聊聊MySQL中auto_increment有什么作用
从零实现深度学习框架——LSTM从理论到实战【理论】
Steady! The best posture for thousands of microservices to access Zadig (helm chart)
AI scene Storage Optimization: yunzhisheng supercomputing platform storage practice based on juicefs
在线文本数字识别列表求和工具
随机推荐
Nacos-配置中心基本使用
低代码、端到端,一小时构建IoT示例场景,声网发布灵隼物联网云平台
The details of industry are all made by money and time
Laravel 创建自己的 Facade 扩展 geoip 根据 IP 获取国家、地域、城市信息
Dynamics 365online lookup lookup field multiple selection
If you master these 28 charts, you will no longer be afraid to be asked about TCP knowledge during the interview
Analyze apache SH script
Steady! The best posture for thousands of microservices to access Zadig (helm chart)
5-2Web应用程序漏洞扫描
leetcode:91. Decoding method [DFS + memorization]
Can you be a coder if you don't learn English well? Stop worrying and learn it first
关于深度学习的概念理解(笔记)
MySQL lock common knowledge points & summary of interview questions
从检查点恢复后读取不到mysql的数据有那位兄台知道原因吗
One click file sharing software jirafeau
交友平台小程序制作开发代码分享
MooseFS 调优笔记
mysql备份数据库linux
Digital tracking analysis of insurance services in the first quarter of 2022
static关键字续、继承、重写、多态