Skip to content

Instantly share code, notes, and snippets.

@dumindu
Last active September 25, 2016 01:52
Show Gist options
  • Save dumindu/8879461bc0cb4532885b to your computer and use it in GitHub Desktop.
Save dumindu/8879461bc0cb4532885b to your computer and use it in GitHub Desktop.
let a = 1;
let b = 2;
let c = a & b; //0 (01 && 10 -> 00)
let d = a | b; //3 (01 || 10 -> 11)
let e = a ^ b; //3 (01 != 10 -> 11)
let f = a << b; //4 (add 2 positions to the end -> '01'+'00' -> 100)
let g = a >> a; //0 (remove 2 positions from the end -> o̶1̶ -> 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment