技术教程 JS 默认参数只在 undefined 时生效 JS 默认参数只在实参为 undefined 时生效,传 0、空串、null 都不会被替换,要兜底用 ??。 技技术小编 2026-10-27 2 阅读 0 评论 js函数参数默认值 es6 默认参数 js 参数 undefined