// length Returns the length of the string
document.write("myStr.length: " + myStr.length); // output: 16
document.write("
");
// prototype Allows you to add properties and methods to an object
// prototype is available for most objects
// Syntax: object.prototype.name=value
function car(make, model, year) {
this.make = make;
this.model = model;
this.year = year;
}
var myCar = new car("Toyota", "Corolla", 2002);
car.prototype.cost = null;
myCar.cost = 20000;
document.write("myCar.cost: " + myCar.cost);
document.write("
");
//*****************************************************
// *** String HTML Wrapper Methods ***
// HTML wrapper methods return the string enclosed in the appropriate
// HTML tags
//*****************************************************
document.write("***String HTML Wrapper Methods***");
document.write("
");
// Method Description
// anchor() Creates an anchor
// Syntax: string.anchor(name) - name is required - it is the name of the anchor
var strName = "Hyperlink"; // this will be text of hyperlink
alert(strName.anchor("Hyper")); // this will be anchor
// string.big() Wraps string in tags
var strBig = "Big"
document.write("strBig.big(): " + strBig.big() + "
");
// string.blink() Wraps string in