export function createElement(tagName, init, ...children) {
    const element = document.createElement(tagName);
    if (typeof init === 'function') {
        init(element);
    } else if (init != null) {
        element.className = init;
    }
    if (children.length > 0) {
        element.append(...children);
    }
    return element;
}
