Minifycode 2020-03-07 Viewed 1.3K times Javascript

In this article, you will learn what is JavaScript Date constructor Property

In this post, the constructor property returns the function that created the string's prototype

  • JavaScript dates the constructor property returns work Date() { [native code] } 
  • JavaScript numbers the constructor property returns work Number() { [native code] } 
  • JavaScript strings the constructor property returns work String() { [native code] }
  • In JavaScript, the constructor property restores the constructor work for an article. 
  • The arrival esteem is a reference to the capacity, not the name of the capacity
<p id="divdemo"></p>

<script>
var dt = new Date();
document.getElementById("divdemo").innerHTML = dt.constructor;
</script>
Date.prototype.toTimeString()
Returns the "time" portion of the Date as a human-readable string

Date.prototype.valueOf()
Returns the primitive value of a Date object. Overrides the Object.prototype.valueOf() method

Date.prototype.toUTCString()
Converts a date to a string using the UTC timezone

Output

function Date() { [native code] }

 

JavaScript Date constructor Property
minify code