ES6对象模型的解构
let formData = { test01: {id: 1, name: 'foo'}, test02: {id: 1, name: "史记"}, test03: {id: 1, name: "汉书"} }; let { test01: fei01, test02: fei02, test03: fei03, } = formData; console.log(formData); // fei01,fei02,fei03 为新的变量............... console.log(fei01); // {id: 1, name: 'foo'} console.log(fei02); // {id: 1, name: "史记"} console.log(fei03); // {id: 1, name: "汉书"} let {test01, test02, test03,} = formData; console.log(test01); // {id: 1, name: 'foo'}