Pergunta de entrevista da empresa Spinny

How DOM works? What are scope in JS?