documentation/demos/tokyo-railways/tokyo-railways.js
function(tag, attrs, children){
    var el = document.createElement(tag);

    if(attrs != null && typeof attrs === typeof {}){
      Object.keys(attrs).forEach(function(key){
        var val = attrs[key];

        el.setAttribute(key, val);
      });
    } else if(typeof attrs === typeof []){
      children = attrs;
    }

    if(children != null && typeof children === typeof []){
      children.forEach(function(child){
        el.appendChild(child);
      });
    } else if(children != null && typeof children === typeof ''){
      el.appendChild(document.createTextNode(children));
    }

    return el;
  }
function(tag, attrs, children){
    var el = document.createElement(tag);

    if(attrs != null && typeof attrs === typeof {}){
      Object.keys(attrs).forEach(function(key){
        var val = attrs[key];

        el.setAttribute(key, val);
      });
    } else if(typeof attrs === typeof []){
      children = attrs;
    }

    if(children != null && typeof children === typeof []){
      children.forEach(function(child){
        el.appendChild(child);
      });
    } else if(children != null && typeof children === typeof ''){
      el.appendChild(document.createTextNode(children));
    }

    return el;
  }
function ( tag , attrs , children ) { var el = document . createElement ( tag ) ; if ( attrs != null && typeof attrs === typeof { } ) { Object . keys ( attrs ) . forEach ( function ( key ) { var val = attrs [ key ] ; el . setAttribute ( key , val ) ; } ) ; } else if ( typeof attrs === typeof [ ] ) { children = attrs ; } if ( children != null && typeof children === typeof [ ] ) { children . forEach ( function ( child ) { el . appendChild ( child ) ; } ) ; } else if ( children != null && typeof children === typeof '' ) { el . appendChild ( document . createTextNode ( children ) ) ; } return el ; }
hyperscript-like function
hyperscript - like function