空值合并运算符(??)是一个逻辑运算符,当左侧的操作数为 null 或者 undefined 时,返回其右侧操作数,否则返回左侧操作数。 st foo = null ?? 'default string'; console.log(foo); // Expected output: "default string"