我不确定这种将对象属性拉入自己的变量的方法是否有特定的名称?如果有名字的话有人知道吗?
var object = {
something: 'a string',
another: 'another string',
}
var { something, another } = object;
最佳答案
这称为object destructuring .
关于javascript - 这个js语法叫什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39239003/