当一次性执行多个方法时,可以通过this[变量]来执行,或者当不确定要找的值时,比如说
let userInfo = { name: 'nini', age: 18, interest: "唱跳rap" } getInfo(content) { console.log(userInfo[content]); } getInfo(name); getInfo(age); getInfo(interest);
当一次性执行多个方法时,可以通过this[变量]来执行,或者当不确定要找的值时,比如说
let userInfo = { name: 'nini', age: 18, interest: "唱跳rap" } getInfo(content) { console.log(userInfo[content]); } getInfo(name); getInfo(age); getInfo(interest);