Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

236
Visualizações
What is exactly the event object?

What is an event object? When is it executed? Why do we have it? For example:

  1. when we use an anonymous function as in this example, the event object will not be renderPosts() function.

    window.addEventListener('DOMContentLoaded', () => renderPosts());
    
    const renderPosts = async () => {
      let uri = 'http://localhost:3000/posts?_sort=likes&_order=desc';
      const res = await fetch(uri);
      const container = document.querySelector(".blogs");```
    
    
  2. when we do not use anonymous function as in this example, the event object will be renderPosts() function.

    window.addEventListener('DOMContentLoaded',renderPosts());
    
    const renderPosts = async () => {
      let uri = 'http://localhost:3000/posts?_sort=likes&_order=desc';
      const res = await fetch(uri);
      const container = document.querySelector(".blogs");```
    
    
    

I do not see the difference and not really understand it.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda