168
rated 0 times
[
171]
[
3]
/ answers: 1 / hits: 66381
/ 10 Years ago, wed, july 30, 2014, 12:00:00
How can I make it so that addEventListener() has two functions inside it?
More From » function
How can I make it so that addEventListener() has two functions inside it?
Wrap your functions in a function.
const invokeMe = () => console.log('I live here outside the scope');
const alsoInvokeMe = () => console.log('I also live outside the scope');
element.addEventListener('event',() => {
invokeMe();
alsoInvokeMe();
});