Is it possible in javascript to make the method name of the variables?

There is a function:
function listener(type, el) {
el.typeEventListener(...)
}

listener('add', el)


They may be implemented in a similar way without the if?
April 4th 20 at 00:43
1 answer
April 4th 20 at 00:45
Solution
Can
class Bla {
 customNameMethod() {
alert()
}
}

const bla = new Bla();

bla["custom" + `Name` + 'Method']();

let methodName = `Name` + 'Method';

bla[`custom${methodName}`]();
Thank you very much, helped and learned new things about js) - hans_Heathcote commented on April 4th 20 at 00:48

Find more questions by tags JavaScript