skip to Main Content

Javascript – Remove the duplicates

How to remove the duplicate strings in an array. I tried this which doesn't workout. var input = ['john','john','rio','ravi','josva','ravi']; let remove = function(){ let result = []; for (let i = 0; i<input.length; i++){ if(input[i] == input[i]){ return false; }else{…

VIEW QUESTION
Back To Top
Search