JSFiddle - React, Tailwind, and code Playground

by kentaromiura

JavaScript

var orig = ['a', 'a', 'b', 'c', 'b'], res = [];
var obj = ((JSON && JSON.parse||JSON.decode)||function(e){return eval('('+e+')')}) ('{"' + orig.join('":"","') +'":""}') ;
for(var x in obj){
    res.push(x);    
}
console.log(orig, res);