Tag Info

New answers tagged

0

The anonymous function you expose in your example is used as a callback function. With this line you ask the browser to listen for a click event on a particular element, like this: toevoegButton.addEventListener('event_name', what_to_do_next()); Here, 'event_name' is 'click', and what_to_do_next() is the code that will get triggered when the element ...


2

Named functions have a name, that is you can refer to them by their name. In JavaScript: function hello() { console.log("Hello, World!"); }; You refer to them by their name for example to pass them as parameters to other functions. For example, in the following code, you use the name hello of the previously written function to pass it to doSomething: ...



Top 50 recent answers are included