Run ❯
Get your
own
website
Result Size:
625 x 565
×
Change Orientation
Save Code
Change Theme, Dark/Light
Go to Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Math</h1> <h2>The Math .clz32() Method</h2> <p>Math.clz32() (short for CountLeadingZeroes32) returns the number of leading zeros in a 32-bit binary representation of a number:</p> <p id="demo"></p> <script> let a = Math.clz32(0); let b = Math.clz32(1); let c = Math.clz32(2); let d = Math.clz32(4); document.getElementById("demo").innerHTML = a + "<br>" + b + "<br>" + c + "<br>" + d; </script> </body> </html>