Articles → 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>





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

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250