Dynamic access to an object property in JavaScript

1 · Coderslang Master · Dec. 17, 2021, 5:27 a.m.
To access the object property dynamically in JS, you need to pass the property name as a string in square brackets. const user = { age: 25, name: 'Jack' } let key = 'age'; console....