当前位置:网站首页>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
边栏推荐
猜你喜欢

If you master these 28 charts, you will no longer be afraid to be asked about TCP knowledge during the interview

夏日彩虹来下饭

Mysql入库不了表情符号怎么办

合宙AIR32F103CBT6开发板上手报告

Unicom warehousing | all Unicom companies that need to sell their products need to enter the general warehouse first

Daily question brushing record (VIII)

每日刷题记录 (八)

Low code, end-to-end, one hour to build IOT sample scenarios, and the sound network released lingfalcon Internet of things cloud platform

5-1系统漏洞扫描

5-1系統漏洞掃描
随机推荐
Problem solving metauniverse, multi communication scheme in online games
Code sharing for making and developing small programs on the dating platform
请教一下,CDC2.2.1可以同时监听多个pgsql 的库吗?
Ce CDC Flink peut - il être utilisé pour la synchronisation incrémentale d'Oracle à MySQL?
Does rapid software delivery really need to be at the cost of security?
5-1系統漏洞掃描
MySQL 锁常见知识点&面试题总结
为什么在局域网(ERP服务器)共享文件夹上拷贝文件时导致全局域英特网断网
What if MySQL fails to store emoticons
Detailed description of gaussdb (DWS) complex and diverse resource load management methods
Realizing deep learning framework from zero -- RNN from theory to practice [practice]
MySQL lock common knowledge points & summary of interview questions
Realizing deep learning framework from zero -- LSTM from theory to practice [theory]
AI scene Storage Optimization: yunzhisheng supercomputing platform storage practice based on juicefs
qt5.14.2连接ubuntu20.04的mysql数据库出错
Arrange the array into the smallest number_ Reverse pairs in an array (merge Statistics)_ Number of occurrences of a number in an ascending array_ Ugly number (Sword finger offer)
Hidden worries behind the listing of shushulang: the performance has declined significantly, the market position is relatively backward, and the competitiveness is questionable
【多线程】 如何自己实现定时器
[multithreading] how to implement timer by yourself
[proteus simulation] digital tube display of stepping motor speed