我有两种方法
var variable_to_be_passed; // setting this does not seem to work
A.prototype.beforeEach = function(callback) {
variable_to_be_passed = 5;
ParentA.prototype.beforeEach.call(this, test, function() {
callback();
});
A.prototype.afterEach = function(variable_to_be_passed, callback) {
console.log(variable_to_be_passed) //prints undefined
ParentA.prototype.afterEach.call(this, test, function() {
callback();
});
我想访问A.prototype.aftereach中的variable_to_be_passed。有人可以建议如何做到这一点吗?
由于