Blogger Information
Blog 42
fans 0
comment 0
visits 15674
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
0719 js函数
小言
Original
378 people have browsed it

1、命名函数

  1. function genName(username){
  2. return 'hello,' + username;
  3. }
  4. console.log(genName('我是测试'));

2、匿名函数

  1. let getUserName = function (username){
  2. return 'hello' + username;
  3. };
  4. console.log(getUserName('测试一下7月20号'));
  5. console.log(getUserName('测试一下7月21号'));
  6. console.log(getUserName('测试一下7月22号'));

3、剪头函数

  1. getUserName = username => {
  2. return 'hello' + username;
  3. };
  4. console.log(getUserName('测试今天'));

Correcting teacher:PHPzPHPz

Correction status:unqualified

Teacher's comments:箭头函数, arrow function,和剪头函数没关系
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