showing results for - "javascript dynamic property accessor"
Jaret
03 Feb 2020
1var something = {
2  bar: 'foo'
3};
4var foo = 'bar';
5
6// both x = something[foo] and something[foo] = x work as expected
7console.log(something[foo]);
8console.log(something.bar)