当一次性执行多个方法时,可以通过this[变量]来执行,或者当不确定要找的值时,比如说
let userInfo = { name: 'nini', age: 18, interest: "唱跳rap" } getInfo(content) { console.log(userInfo[content]); } getInfo(name); getInfo(age); getInfo(interest);
标签:变量,getInfo,age,content,userInfo,interest,写法,name From: https://www.cnblogs.com/wyl-k/p/17716612.html