Javascript examples for Statement:if
Compare value in if statement
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from w w w. j a va 2 s . co m var p = 100; if(100 > p >= 10){ console.log("0." + p); } else if(p < 10){ console.log("0."+ "0" + p); } else{ console.log(1); } } </script> </head> <body> </body> </html>