JSFiddle - React, Tailwind, and code Playground

JavaScript

var a = ["color", "radius", "y", "x", "x", "x"];
var uniqueval = a.filter(function (itm, i, a) {
    return i == a.indexOf(itm);
});
if (a.length > uniqueval.length) {
    alert("duplicate elements")
}
else
{
    alert('Unique elements')
}