M
M
Megalexandros2021-07-13 13:08:15
JavaScript
Megalexandros, 2021-07-13 13:08:15

How to rewrite the arrow f-th to the usual one?

for (let i=0;i < itemTest.length;i++){
    itemTest[i].addEventListener('click', (e) => {choosen(e)} )
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2021-07-13
@Megalexandros

There is no need for an anonymous function here:
itemTest[i].addEventListener('click', choosen)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question