I\'m trying to pass some parameter to a function used as callback, how can I do that?
function tryMe (param1, param2) {
alert (param1 + \" and \" + param
Use curried function as in this simple example.
const BTN = document.querySelector('button')
const RES = document.querySelector('p')
const changeText = newText => () => {
RES.textContent = newText
}
BTN.addEventListener('click', changeText('Clicked!'))
<button>ClickMe</button>
<p>Not clicked<p>