<html> <head></head> <body> <script type="text/javascript"> var objct1= new objct(); objct1.checkIfActive(); // Error.......... Object doesn't support this property or method...... var objct2= new objct(true); objct2.checkIfActive(); function objct(isUnderCover) { if(isUnderCover) this.isSecret=true; } objct.prototype.isSecret=false; objct.prototype.isActive=true; objct.prototype.checkIfActive=function() { if(this.isActive) alert("This Object is Active...is this secret..?"+this.isSecret) else alert("This Object is Not Active...is this secret..?"+this.isSecret) }; </script> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)