code: function(val, ifTrue, ifFalse) {
      ifTrue = ifTrue || true;
      let type = typeof(val);
      if (type === "number") {
        return ifTrue;
      }
      if (type === "undefined" || val === null) {
        return ifFalse;
      }
      if (Array.isArray(val)) {
        return val.length ? ifTrue : ifFalse;
      }
      if (type === "object") {
        return Object.keys(val).length === 0 && val.constructor === Object ? ifFalse : ifTrue;
      }
  
      // Catch all including boolean type
      return val ? ifTrue : ifFalse;
      
    }
docs: Check passed in value to see if it is of interest in the following way: - is it defined at all? - if it is an array, does it have any values? - if it is an object, does it have properties? - if it is a number, always return true If the checks fail, then return ifFalse or undefined, otherwise return ifTrue || true  This can be used to prefix rendering blocks with jst.if(val) && ..., e.g.: render() { // this works because 'undefined' is silently skipped in Jayesstee return jst.if(myList) && jst.$ul(myList.map(item => jst.$li(item))) } or if you prefer, you can do a tertiary expression: jst.if(val) ? ... : ...  Note that if you pass in a boolean, 'false' will return 'undefined' and 'true' will return 'true'