批改状态:合格
老师批语:
var let const
const>let,不用var,let是块作用域,并且bi’a
JS不能够再同一个作用域内申明两次变量
undefined:定义,没有赋值的变量
boolean:
string:
number:
1.函数基本定义:
function sum(a,b){return a+b;// 没有返回,就返回undefined}let a=34 ,b=1;console.log(sum(a,b))
2.匿名函数
let name;name = function (userName){return 'My name is'+userName;}console.log(name('123'));
3.箭头函数
let name;name = userName =>{return 'My name is'+userName;}console.log(name('123'));
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号