Pergunta de entrevista da empresa PathFactory

When would you use a javascript framework and why?