JavaScript Date constructor Property

The JavaScript Date constructor property returns the date’s constructor function.

Following is the code for JavaScript Date constructor property −


 Live Demo

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
   body {
      font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
   .sample {
      font-size: 20px;
      font-weight: 500;
<h1>Date constructor Property</h1>
<div class="sample"></div>
<button class="Btn">CLICK HERE</button>
Click on the above button to see the date constructor function
   let fillEle = document.querySelector(".sample");
   let date= new Date();
   fillEle.innerHTML = date + '<br>';
   document.querySelector(".Btn").addEventListener("click", () => {
      fillEle.innerHTML += date.constructor;


On clicking the “CLICK HERE” button −