这串代码怎么解读,详细的,尤其是return哪里
function callTheRoll() {
var persons = ['1', '2', '3', '4', '5'];
var blacklist = [];
return {
callName: function(name) {
// if (persons.indexOf(name) > -1) {
if (~persons.indexOf(name)) {
console.log('this one is here');
} else {
console.log('this one is not here');
blacklist.push(name);
}
},
getBlackList: function() {
console.log(blacklist);
}
}
}
var myRoll = callTheRoll();
console.log(myRoll.blacklist); // undeifed
myRoll.callName('2')
myRoll.callName('9')
myRoll.getBlackList();