JSFiddle - React, Tailwind, and code Playground

by mrunali tatkundawar

HTML

<html>
<head>
<title>My practise session</title>
</head>
</html>

JavaScript

var Val = new String("my name is xyz")
var Val1 = new String("my name is abc")
var Val2 = new String("my name is lmn")
var Val3 =  Val1.concat(Val2)//Combines the text of two strings and returns a new string.
var Val4 =  Val2.indexOf("is")//Returns the index within the calling String object of the first occurrence of the specified value, or -1 if not found.
var Val5 = Val2.lastIndexOf("lmn")//Returns the index within the calling String object of the last occurrence of the specified value, or -1 if not found.
var Val6 = Val2.localeCompare( "XYZ" );//Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order.
var re =  ("is lmn")
var found = Val2.match( re );//Used to match a regular expression against a string.
var re1 = ("xyz")
var re2 = ("xyz")
var stringtoadd = Val.replace(re1,"megha");//Used to find a match between a regular expression and a string, and to replace the matched substring with a new substring.

var found1 = Val2.split( " ",4 );


//document.write("Introduction : " + 	Val + "</br>")
//document.write(Val.charAt(1) + "</br>");//charAt()Returns the character at the specified index.
//document.write(Val.charCodeAt(3) + "</br>");//Returns a number indicating the Unicode value of the character at the given index.
//document.write(Val3 + "</br>");
//document.write(Val4 + "</br>");
//document.write(Val5 + "</br>");
//document.write(Val6 + "</br>");
//document.write(found+ "</br>"); 
//document.write(stringtoadd+ "</br>"); 

/*if (Val2.search (re2) == -1){
  document.write("do not contain string")
} else {
  document.write("contains string")

}//Executes the search for a match between a regular expression and a specified string.*/

//document.write(found1)

document.write("(1,2): "    + Val2.substr(1,2));
document.write("<br />(-2,2): "   + Val2.substr(-2,2));
document.write("<br />(1): "      + Val2.substr(1));
document.write("<br />(-20, 2): " + Val2.substr(-20,2));
document.write("<br...