js中序列解包方式获取json对象中的值
A little trick
function getHeight_Width(obj){
return {
width: obj.width,
height: obj.height
}
}
var { width, height } = await getHeight_Width(imgObj);
function getHeight_Width(obj){
return {
width: obj.width,
height: obj.height
}
}
var { width, height } = await getHeight_Width(imgObj);