Articles → JavaScript → Instanceof Operator In Javascript

Instanceof Operator In Javascript






Instance Creation In Javascript




var date = new Date();
var obj = new Object();





Purpose Of Instanceof





Syntax


instanceName Instanceof ObjectType



Example


<script type="text/javascript">
        var date = new Date();
        var obj = new Object();
        alert(date instanceof Date);
        alert(obj instanceof Date);
</script>

Try It




Posted By  -  Karan Gupta
 
Posted On  -  Sunday, December 25, 2016

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250