function removeDuplicate(arr) { const newArr = [] const obj = {} arr.forEach(item => { if (!obj[item]) { newArr.push(item) obj[item] = true } }) return newArr } const results = removeDuplicate( [[2, 2], [2, 2]]); console.log(results)