/** * @param {string} name * @param {HTMLElement.prototype} props * @param {Array<HTMLElement|string>} children * @return HTMLElement */ function $h(name = 'div', props = {}, children = []) { const el = document.createElement(name); Object.assign(el, props); el.append(...children); return el; }