Prev Demo
Returning The Primitive Value Without Using Valueof() Method.
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Returning the primitive value without using valueOf() method.</h1> <p>Click the below button to return the primitive value of string object.</p> <input type="button" value="Primitive Value" onclick="Function()" /> <p id="myId"></p> <script> function Function() { var a = "TechFunda"; var r = a; document.getElementById("myId").innerHTML = r; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output