var a = { name: ‘a‘; age: 18; } a.name; //返回 a a.age; //返回 18
var a = { name: ‘a‘; age: 18; } a[‘name‘]; //返回 a var b = "age"; a[b]; // 返回 18
javascript:对象的点语法和中括号语法索引
原文:https://www.cnblogs.com/clisen/p/14469817.html