| valueOf() The valueOf() method is used to return the primitive value of the object it has been invoked upon. If it is invoked upon a string object, the string text itself is returned. Examine the syntax and example to get a feel for the use of this method. syntax: string.valueOf() EXAMPLE var theString = new String("This is the string text"); document.write("The contents of theString is : " + theString.valueOf() ); The variable theString if first created, and is a string of text. The document.write statement then writes osxme applicable text to the screen along with the contents of theString, with the valueOf() method invoked upon it. The ouput should look like the following: The contents of theString is : This is the string text |