Javascript Try the following example. JavaScript String length Property var str = new String( "This is string" ); document.write("str.length is:" + str.length); Output str.length is:14 Prototype The prototype property allows you to add properties and methods to any object (Number, Boolean, String, Date, etc.). Note: Prototype is a global property which is available with almost all the objects. Syntax Its syntax is as follows: object.prototype.name = value Example Try the following example. User-defined objects 138

Javascript function book(title, author){ this.title = title; this.author = author; } var myBook = new book("Perl", "Mohtashim"); book.prototype.price = null; myBook.price = 100; document.write("Book title is : " + myBook.title + ""); document.write("Book author is : " + myBook.author + ""); document.write("Book price is : " + myBook.price + ""); Output Book title is : Perl Book author is : Mohtashim Book price is : 100 String Methods Here is a list of the methods available in String object along with their description. charAt() Method charCodeAt() Description Returns the character at the specified index. Returns a number indicating the Unicode value of the character at the given index. 139