js 权限二进制
const READ = 0b1; const CREATE = 0b10; const UPDATE = 0b100; const DELETE = 0b1000; const rights = READ | UPDATE | DELETE //组合权限读 更新 删除 13 console.log(rights) //13 if ((rights && READ) === 1) { console.log('有read权限') } else { console.log('没有read权限') } if ((rights ^ READ) === 0b1100) { console.log('删除read权限') } else { console.log('有read权限') }