JSFiddle - React, Tailwind, and code Playground
HTML
<p>Some text for testing this thing. I want to remove the dependency on this div#selection but cannot figure out how to do it!</p>
<div id="selection"></div>
CSS
#element {
width: 20px;
height: 20px;
background-color: #CCC;
display: inline-block;
}
JavaScript
var my_array1 = [1, 2, 3]
var my_array2 = [1, 1, 1]
function isUnique(obj)
{
var unique=obj.filter(function(itm,i,a){
return i==a.indexOf(itm);
});
return unique.length==obj.length?true:false;
}
alert(isUnique(my_array1))
alert(isUnique(my_array2))