Pergunta de entrevista da empresa Karat

some javascript question .. made use of split().