Create element

twitter.com
js
createElement = (name, props) =>
Object.assign(document.createElement(name), props);
const button = createElement("button", {
textContent: "Log Yar Click!",
onclick(e) {
console.log("Yar!", e);
}
});
document.body.appendChild(button);