JavaScript 解构赋值:undefined 和 null 赋值给变量
A. undefined 1\n\n当使用解构赋值时,如果数组元素为 undefined,则变量将被赋值为 undefined。如果数组元素为 null,则变量将被赋值为 null。\n\n因此,代码 let [x = 1] = [undefined] 将使 x 等于 undefined,而代码 let [x = 1] = [null] 将使 x 等于 null。\n\n正确答案是:A. undefined 1
原文地址: https://www.cveoy.top/t/topic/pKe2 著作权归作者所有。请勿转载和采集!