Pergunta de entrevista da empresa Swrve

Given two arrays get common elements and return them in an array.