showing results for - "javascript check if number is a power of 2"
Athénaïs
18 Nov 2018
1function powerOfTwo(x) {
2    return Math.log2(x) % 1 === 0;
3}