Exploring a dynamic method call with parameters in JavaScript.
let obj = {
method: 'foo1',
params: ['one', 'two']
}
foo1(p1, p2) {
// do something
}
To execute it =>
[obj.method](obj.params)
Is there a way to dynamically add parameters from an array?