Here is an easy way to get only unique raw values from array. If you convert the array to Set and after this, do the conversion from Set to array. This conversion works only for raw values, for objects in the array it is not valid. Try it by yourself.
let myObj1 = { name: "Dany", age: 35, address: "str. My street N5" } let myObj2 = { name: "Dany", age: 35, address: "str. My street N5" } var myArray = [55, 44, 65, myObj1, 44, myObj2, 15, 25, 65, 30]; console.log(myArray); var mySet = new Set(myArray); console.log(mySet); console.log(mySet.size === myArray.length);// !! The size differs because Set has only unique items let uniqueArray = [...mySet]; console.log(uniqueArray); // Here you will see your new array have only unique elements with raw // values. The objects are not filtered as unique values by Set. // Try it by yourself.