delete operation on instance itself versus on constructor - Javascript Object

Javascript examples for Object:Constructor

Description

delete operation on instance itself versus on constructor

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
    window.onload=function(){// w ww .j av a2s.c o m
function Person(){
   this.name='person';
}
function Parent(){
  this.name='parent';
}
Person.prototype=new Parent();
var person1=new Person();
person1.name='newPerson';
console.log(delete (Person.name));
console.log(person1.name);
    }

      </script> 
   </head> 
   <body>  
   </body>
</html>

Related Tutorials