10.07.2017 Views

javascript_tutorial

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Javascript<br />

<br />

var str = "Apples are round, and Apples are Juicy.";<br />

document.write(str.toUpperCase( ));<br />

<br />

<br />

<br />

Output<br />

APPLES ARE ROUND, AND APPLES ARE JUICY.<br />

valueOf ()<br />

This method returns the primitive value of a String object.<br />

Syntax<br />

Its syntax is as follows:<br />

string.valueOf( )<br />

Return Value<br />

Returns the primitive value of a String object.<br />

Example<br />

Try the following example.<br />

<br />

<br />

JavaScript String valueOf() Method<br />

<br />

<br />

<br />

var str = new String("Hello world");<br />

document.write(str.valueOf( ));<br />

<br />

<br />

<br />

162

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!