Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaScriptbitwise operatorsSingle-choice MCQ

Why does the expression `n & (n - 1)` equal 0 exactly when `n` is a power of two (for positive integers)?

console.log(8 & 7, 16 & 15, 6 & 5, 12 & 11);