Javascript - String fixed() Method

The fixed() method can display a string as teletype text.

Description

The fixed() method can display a string as teletype text.

This method returns the string embedded in the <tt> tag, like this:

<tt>string</tt>

Syntax

string.fixed()

Parameters

None

Return

A string embedded in the <tt> tag

Example

Display text as teletype text:

Demo

var str = "Hello World!";
var result = str.fixed();
console.log(result);

Result