+ 1
Document.addEventListener('DOMContentLoaded',( ) =>{
Explain me this syntaxe plz ?
3 Respostas
+ 6
1.Document = who listens to event
2. addEventListener = method (in this case) of Document that adds a new reaction to an event.
The method expects two parameters
a) the Event (DOMContentLoaded)
b) a function
In this case the function is passed as a function without a name and without parameters.
( ) => {function body}
This kind of functions without name are arrow functions.
+ 5
After Oma Falk 's explanation, I just want to add one thing that; DOMContentLoaded event is initialised when the entire HTML document is loaded.
Thanks.
Happy Coding 🤠
+ 1
Oma Falk DOMContentLoaded ?