批改状态:合格
老师批语:
let f = (a = 0,b = 0)=>{return a + b;}console.log(f());
//...rest:用在形参中,归并let f = (a,b,...c)=>{return a + b;}console.log(f(1,2,3,4,5...));//参数过多求和用数组求和函数(形参名).reducelet f = (...arr)=>arr.reduce(a + c)=>a+c;
//返回单值let fn = ()=>{return result;}//返回多个值:对象、数组let fn = ()=>[a,b,c]//数组let fn = ()=>({a,b,c})//对象
let name = '张老师';console.log(`Hello ${name}`);
alert`Hello world`;
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号