-We created a variable and named it j because the letter j is a fine letter.
-We applied Javascript's built-in sub method to our j string.
-We stored those results back into j.
-We used Javascript's built-in document.write to print to the browser.
We could have also written this a little differently, like so:
j="TM";
document.write("This is a good time." + j.sub());
ADVANCED: You can also apply more than one method to the string:
j="TM";
j=j.italics().sub().link('http://google.com');
document.write("This is a good time." + j);
or
j="TM";
document.write("This is a good time." + j.italics().sub().link('http://google.com'));
Free Copy and Paste Javascript Code:
<script type="text/javascript">
<!--
i="TM";
j=i.sub();
document.write(i);
document.write(j);
document.write("This is a good time." + i.sub());