I am currently working with angularjs and there is this pieceof code. I dont get What does it return?
authorize: function(accessLevel, role) {
if(role === undefined) {
role = Session.role;
}
return accessLevel.bitMask & role.bitMask;
},
Some tests
console.log(1&2); //0
console.log(3&7); //3
console.log(5&11); //1
console.log(0.5&11); //0
Anyone has any idea?
Edit: I am sorry that this question was already asked. But since i didnt know the keyword bitwise, or couldnt find any match with the previous topic keywords in my presearch i appriciate the answers here!