LeetCode #231 - Power of Two (JavaScript)

const isPowerOfTwo = n => {
    return n > 0 && !(n & (n - 1))
}