var arr = [\'verdana\', \'Verdana\', 2, 4, 2, 8, 7, 3, 6];
result = Array.from(new Set(arr));
console.log(arr);
console.log(result);
i want to re
You can use Set
after converting the string elements to uppercase
.Here ...
is spread operator
var arr = ['verdana', 'Verdana', 2, 4, 2, 8, 7, 3, 6];
var result = arr.map(function(item) {
return typeof item === "string" ? item.toString().toUpperCase() : item
})
result = [...new Set(result)];
console.log(result);