code: function createElement(tagName) {
    return function (...args) {
      const element  = document.createElement(tagName);
      const attrs    = isObject(args[0]) ? args[0] : {};
      const children = args.length === 2 ? args[1] : args[0];
  
      Object
        .keys(attrs)
        .forEach(name => element.setAttribute(name, attrs[name]));
  
      if (Array.isArray(children)) {
        children.forEach(node => append(element, node));
      }
  
      if (isString(children) && !isVoidElement(tagName.toLowerCase())) {
        append(element, children);
      }
  
      return element;
    };
  }
docs: createElement
  
  @param {String} tagName
  
  @return {Function}