var param = "statut";
// I want this expression :
data.param.function1().function2();
// to be equivalent to :
data.statut.function1().function2();
Asked
Active
Viewed 69 times
-2

Sudhir Ojha
- 3,247
- 3
- 14
- 24

Kalvain
- 29
-
1maybe this will help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors. `data[param]function1().function2()` Square bracket notation allows you to dynamically access properties of an Object – Francis Leigh May 10 '19 at 12:08
-
Possible duplicate of [Dynamically access object property using variable](https://stackoverflow.com/questions/4244896/dynamically-access-object-property-using-variable) – VLAZ May 10 '19 at 12:08