var 256 var Math log Math log var Math floor if y-z console log YES el

1
2
3
4
5
6
7
8
var x = 256;
var y = Math.log(x)/Math.log(2);
var z = Math.floor(y);
if ((y-z)===0){
console.log("YES")
}else{
console.log("NO")
}