Today I learned about Object.assign() and how it can make DOM node creation code look a bit more compact:
document.body.appendChild(
Object.assign(document.createElement('div'), {
style: 'color: red;',
className: 'foo bar',
textContent: 'Hello, world!'
})
);
Object.assign(target, source) copies all properties from source to target, and returns target.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
@patrickbrosset my personal choice is ~ https://developer.mozilla.org/en-US/docs/Web/API/Range/createContextualFragment