📜  javascript 按位标志 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:45.238000             🧑  作者: Mango

代码示例1
var myEnum = {
  left: 1,
  right: 2,
  top: 4,
  bottom: 8
}

var myConfig = myEnum.left | myEnum.right;

if (myConfig & myEnum.right) {
  // right flag is set
}