Using String small() method to coding in Javascript/JS

This JavaScript tutorial explains how to use the string approach referred to as small() with syntax and examples.


In JavaScript, small() is a string approach that is used to create the HTML element. Because the small() technique is a method of the String object, it must be invoked through a precise instance of the String class.


In JavaScript, the syntax for the small() technique is:


Parameters or Arguments

There are no parameters or arguments for the small() method.


The small() technique returns a reproduction of string enclosed in and tags.


The small() approach does not alternate the cost of the unique string.


Let’s take a seem to be at an example of how to use the small() method in JavaScript.

For example:

var totn_string = 'TechOnTheNet';


In this example, we have declared a variable known as totn_string that is assigned the string price of ‘TechOnTheNet’. We have then invoked the small() method of the totn_string variable to return a string that consists of the HTML element.

We have written the output of the small() technique to the web browser console log, for demonstration purposes, to show what the small() method returns.

The following will be output to the internet browser console log:


As you can see, the small() method created a string that incorporates a element. The value of the totn_string variable (which is ‘TechOnTheNet’) is enclosed inside the and tags.