I'm using some code in JS and I bumped into these (unrelated) expressions:
1) var r = (d + Math.random() * 16) % 16 | 0;
2) return c === 'x' ? r : (r & 0x3 | 0x8);
I read some about bitwise operators but it does not help in this context. Can somebody explain (preferably step-by-step) how do they work ? How this two expressions are logically evaluated and run ?
Thanks in advance.