摘要: ?: ?:是指可选参数,可以理解为参数自动加上undefined function echo(x: number, y?: number) { // 可选参数 return x + (y || 0); } getval(1); // 1 getval(1, null); // error, 'nul 阅读全文
posted @ 2022-04-19 10:38 探索之路慢慢 阅读(1032) 评论(0) 推荐(0) 编辑