in the following code, i need call the "private" method run in the sub class Worker
function Person(scope, ...) {
scope.name = "Juan";
var run = function() {
console.log(scope.name + " is running");
};
}
function Worker(scope, ...) {
Person.call(this, scope, ...);
var jumpAndRun = function() {
console.log(scope.name + " is jumping");
run(); // how to call this
};
}
Worker.prototype = Object.create(People.prototype);
currently if i call run method i get an Error: run is not defined!
Peopleconstructor function scope, not somehow "protected".runandjumpAndRuninvoked anyway?scope?