Edit This Code:
<!DOCTYPE html>
<html>
<body>

<p>This "home made" function, when used on an date, returns true.</p>

<p id="demo"></p>

<script>
var myDate = new Date();
document.getElementById("demo").innerHTML = isDate(myDate);

function isDate(myDate) {
    return myDate.constructor.toString().indexOf("Date") > -1;
}
</script>

</body>
</html>


Result:
Try it Yourself - © w3schools.com
Privacy Policy