Hello I have this sheet of Javascript code :
var asyncFunction = function (cb) {
setTimeout(function () {
cb('accepted');
}, Math.floor(Math.random() * 5000));
};
var Applicant = function (applicant_name_var, applicant_age_var) {
var name = applicant_name_var;
var a = applicant_age_var;
return {
who_AM_I: function () {
if (name == null) { return 'No Name'; }
else {
return name;
}
},
INTERVIEWRESULT: function () {
var result = 'pending';
asyncFunction(function (result) {
result = result;
});
return result;
}
};
};
What I am looking for is to change the value of result in INTERVIEWRESULT from "pending" to "accepted".
Please could you help me to fix the code above