JSFiddle - React, Tailwind, and code Playground

by swoogie

JavaScript

_.mixin({
  //If you would like to know how these functions word, read the docs.
  isSet: function(e) {
    return (_.isArray(e) && (_.filter(e, function(x) {
      return (x[0] !== "")
    }).length > 0)) || (_.isString(e) && e.length > 0);
  },
  isTrue: function(e) {
    return e === "1";
  },
  toQueryString: function(e, d) {
    d = d || {};
    return _.chain(e).filter(_.isSet).map(function(ele) {
      return ele.join(d.equivilator || "=");
    }).value().join(d.delimiter || "&");
  }
});

var x = (function (m) {return (m === '1') ? 'm=' + m : '';})({
    m: "1"
});

console.log(x);