标签:箭头 console 设置 pre 参数 箭头函数 默认值 undefined turn
// ES5 // 设置参数默认值,未传入参数时按照默认值 function f(x, y, z) { if (y === undefined) { y = 7 } if (z === undefined) { z = 42 } return x + y + z } console.log(f(1)) // 50 console.log(f(1, 8, 43)) // 52
标签:箭头 console 设置 pre 参数 箭头函数 默认值 undefined turn
原文地址:https://www.cnblogs.com/xzweb/p/12271164.html