如何将对象分解为已定义的变量?
2022-08-30 01:39:22
下面将生成语法错误:
let source,
screenings,
size;
source = {
screenings: 'a',
size: 'b'
};
{
screenings,
size
} = source;
预期结果:
screenings should be equal to 'a'
size should be equal to 'b'