This one returns if the number is the power of two up to 64 value ( you can change it inside for loop condition ("6" is for 2^6 is 64);
const isPowerOfTwo = (number) => { let result = false; for (let i = 1; i <= 6; i++) { if (number === Math.pow(2, i)) { result = true; } } return result;};console.log(isPowerOfTwo(16));console.log(isPowerOfTwo(10));