| var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); } var empinfo = (function () { function empinfo(emp_id, fname, lname) { this.emp_id = emp_id; this.fname = fname; this.lname = lname; } empinfo.prototype.sayinfo = function () { var span = document.createElement("span"); span.style.color = "green"; span.style.fontFamily = "Arial Black"; span.innerText = "\n Base Class sayinfo() function\nEmp Id ->" + this.emp_id + "\n Frist Name ->" + this.fname + "\nLast Name ->" + this.lname; document.body.appendChild(span); }; return empinfo; })(); var emp = (function (_super) { __extends(emp, _super); function emp() { _super.apply(this, arguments); } emp.prototype.sayinfo = function () { var span = document.createElement("span"); span.style.color = "Blue"; span.innerText = "\n DriveClass sayinfo() function Override BaseClass sayinfo() function\n Frist Name ->" + this.fname + "\nLast Name ->" + this.lname + "\nEmp Id ->" + this.emp_id; document.body.appendChild(span); }; return emp; })(empinfo); window.onload = function () { var first = new emp(201, "Sachin","Bhardwaj"); first.sayinfo(); var second = new empinfo(101, "Nitin","Bhardwaj"); second.sayinfo(); }; |