JSFiddle - React, Tailwind, and code Playground

by cmruser

JavaScript

//http://stackoverflow.com/questions/6268679/best-way-to-get-the-key-of-a-key-value-javascript-object
var rules = {
    // box border
    borderWidth: "0px",
    borderStyle: "solid",
    borderColor: "transparent",
    border: "0px solid transparent",
    borderTop: "",
    borderRight: "",
    borderBottom: "",
    borderLeft: "",
}
/*
var keys = $.map(rules, function(item, key) {
    if(item == "") {
        alert(key);
    }
});
*/

function isEmpty(map) {
   for(var key in map) {
      if (map.hasOwnProperty(key)) {
         return false;
      }
   }
   return true;
}

 //$.each(rules, function(index, key) {
     //console.log(sectionStyle.Rules[index]);
     //console.log(key);
     //for(key in rules) {
        // console.log(key);
         //console.log(rules[key]);
    // }
 //});
/*
for(var i in foo){
  alert(i); // alerts key
  alert(foo[i]); //alerts key's value
}
*/