How to use ValueOf in Javascript

In this article I am going to explain about ValueOf() method in JavaScript.
  • 1860

JavaScript ValueOf() Method

JavaScript ValueOf() method use for find primitive value of Date object. When its function execute primitive value will return in the form of millisecond since 1 January 1970.






    <script type="text/javascript">

        function myfun() {

            var dd = new Date();

            var mm = document.getElementById("tst");

            mm.innerHTML = dd.valueOf();






        click button to show primitive value</p>

    <h3 id="tst" style="color: red">


    <button onclick="myfun()">

        click me</button>








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


More Articles

© 2020 DotNetHeaven. All rights reserved.