📜  javascript 解构 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:49.210000             🧑  作者: Mango

代码示例6
const classDetails = {
  strength: 78,
  benches: 39,
  blackBoard:1
}

const {strength:classStrength, benches:classBenches,blackBoard:classBlackBoard} = classDetails;

console.log(classStrength); // Outputs 78
console.log(classBenches); // Outputs 39
console.log(classBlackBoard); // Outputs 1