Pergunta de entrevista da empresa epay

Whats the difference between map and foreach in javascript