Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- testA = function(){
- this._data = [];
- }
- testA.prototype.add = function(data){
- this._data.push(data) // Here i am facing this._data is undefined
- }
- testB = function(){}
- testB.prototype = Object.create(testA);
- var instance = new testB;
- testB.prototype.pushData = function(data){
- instance.prototype.add(data);
- }
- function (data){
- instance.prototype.add(data);
- }
- instance.pushData("someData")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement