How To Use String Object ValueOf In JavaScript

In this article I am going to explain about String Object ValueOf In JavaScript.
  • 1395

Use valueOf() method in JavaScript

This method returns a string value and represent the source code of a function.

This method overrides the object.valueOf method in JavaScript.

The valueOf() method is usually called automatically by JavaScript behind the scenes, and not explicitly in code.

All browsers support string object valueOf() method.

Syntax

string.valueOf()

Example

<!DOCTYPE html>

<html>

<body style ="background-color :Red">

 

<script type="text/javascript">

 

    var str = "<br/>Welcome dotnetheaven!";

   

    document.write(str.valueOf());

 

</script>

 

</body>

</html>

Output1

 op1.jpg

Further Readings

You may also want to read these related articles :here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.