const contentString = "Hello, world";
document.body.innerHTML = contentString.bold();String.prototype.bold() / notebook
String.prototype.bold()
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
<b>Hello, world</b>const contentString = "Hello, world";
const elem = document.createElement("b");
elem.innerText = contentString;
document.body.appendChild(elem);