Home
<!DOCTYPE html> <html> <body> <h1>Demo: JavaScript Boolean</h1> <script> var YES = true; var NO = false; if(YES) { alert("This code block will be executed"); } if(NO) { alert("This code block will not be executed"); } </script> </body> </html>
Result: