JavaScript Program to Find Duplicate Elements in an Array
Here are the different methods to find duplicate elements in the array1. Using Nested For In LoopThe for...in loop is typically used to iterate over the keys of an object or the indices of an array.JavaScriptconst a = [1, 2, 3, 4, 5, 2, 3, 6]; let dupli = []; for (let i in a) { for (let j in a) { if