Pergunta de entrevista da empresa Brihat Infotech

Given an array consisting of duplicate elements remove the duplicates without using in built functions such as map or filter. Had to be coded is JS only