Here is my code
var array1 = [1,1, 30, 4, 21];
array1.sort();
console.log(array1);
// expected output: Array [1, 21, 30, 4]
I want to get the result [1,4,21,30]. the sort function should have give expected result [1,1,4,21,30] it is not giving that . Furthermore what approaches should i take just to keep one "1"? as I dont want duplications