const obj = { name: 'John Foo', email: 'john.foo@aaa.com' }; let prop = 'name'; console.log(obj[prop]); // 'John Foo' prop = 'email'; console.log(obj[prop]); // 'john.foo@aaa.com'
No comments:
Post a Comment