I am trying to write and learn using Object.prototype and I am getting the error saying that this.issue
is not a function when I call it within another method. What am I doing wrong that is causing it to through this Uncaught TypeError?
The Javascript:
$(document).ready(function() {
var Example = function() {
this.number1 = null;
this.number2 = null;
};
Example.prototype.issue = function() {
//Logic is here...
};
Example.prototype.updateNumber = function() {
//more logic is here...
this.issue();
};
Example.prototype.updateSign = function() {
//logic here...
this.issue();
};
(function() {
var solution = new Example();
})();
});
UPDATE: https://jsfiddle.net/czLtc82y/