This JavaScript tutorial explains how to use the string approach referred to as small() with syntax and examples.
Description
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.
Syntax
In JavaScript, the syntax for the small() technique is:
string.small();
Parameters or Arguments
There are no parameters or arguments for the small() method.
Returns
The small() technique returns a reproduction of string enclosed in and tags.
Note
The small() approach does not alternate the cost of the unique string.
Example
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';
console.log(totn_string.small());
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:
<small>TechOnTheNet</small>
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.
Leave a Review