let arr = [1,1,1,1,1,2,3,4,1,2,3,4,2,3];
function nam(val){
let array= val;
let res = [];
for(let i = 0; i < array.length; i++){
if(res.includes(array[i]) ) return
res.push(array[i])
}
return res;
}
nam(arr);
if(res.includes(array[i]) ) return res.push(array[i])