JavaScript String bold() methode

Definitie en gebruik

De methode String bold() is in JavaScript verouderd.

Avoid using it.

It may stop running at any time in your browser.

bold() The method returns the string embedded in the <b> tag:

<b>string</b>

Example

Display text in bold:

let text = "Hello World!";
let result = text.bold();

Try it yourself

Syntax

string.bold()

Parameters

No parameters.

Return value

String embedded in the <b> tag.