JSFiddle - React, Tailwind, and code Playground

by Aravind Subramanian

JavaScript

var arr = ['a', 'b', 'c'];
var obj = {},
    temp = 'asd';
for(var i=0; i<arr.length; i++){
    if($.isEmptyObject(obj)){
        obj[arr[i]] = {};
    } else {
        console.log(Object.keys(obj));
        obj[Object.keys(obj)][arr[i]] = {};
    }
}
console.log(obj, temp);