Blogger Information
Blog 43
fans 0
comment 3
visits 27034
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
1. 实例演示常用函数类型 2.实例演示常用数据类型
Time
Original
512 people have browsed it

常用函数类型

命名函数

  1. // 命名函数
  2. function test(num = '') {}

匿名函数

1.普通匿名函数

  1. // 匿名函数
  2. let test1 = function (num = '') {};

2.匿名函数(立即调用函数)

  1. //匿名函数(立即调用函数):声明与调用二合一
  2. console.log(
  3. (function (username) {
  4. return "Hello" + username;
  5. })("zhang")
  6. );

3.箭头函数:简化匿名函数

  1. // 箭头函数:简化匿名函数
  2. let ceshi = (a, b) => {
  3. return a + b;
  4. };
  5. console.log(ceshi(3, 2));

常用数据类型

1.原始类型

  1. number,string,boolean,undefined,null

2.引用类型

  1. arrat,object,function
Correcting teacher:PHPzPHPz

Correction status:qualified

Teacher's comments:数据类型可以加些例子
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post