Pergunta de entrevista da empresa Marmeto

One of the tasks they asked me to code during the technical round was to write a JavaScript function