var arr = [55, 44, 65,1,2,3,3,34,5];
var unique= [...newSet(arr)]
//just var unique=newSet(arr) wont be an array
let a = ["1", "1", "2", "3", "3", "1"];
let unique = a.filter((item, i, ar) => ar.indexOf(item) === i);
In this page (written and validated by A. Gawali) you learned about
Incorrect info or code snippet? We take very seriously the accuracy of the information provided on our website. We also make sure to test all snippets and examples provided for each section. If you find any incorrect information, please send us an email about the issue: firstname.lastname@example.org.