Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. var number = 5;
  12.  
  13. if (number % 2 === 1) { // Was failing this, had to add === 1 as a comparitor since we needed booleen value for the else if statement
  14. console.log('odd');
  15. } else {
  16. console.log('even');
  17. }
  18. </script>
  19.  
  20.  
  21.  
  22. <script id="jsbin-source-javascript" type="text/javascript">var number = 5;
  23.  
  24. if (number % 2 === 1) { // Was failing this, had to add === 1 as a comparitor since we needed booleen value for the else if statement
  25. console.log('odd');
  26. } else {
  27. console.log('even');
  28. }</script></body>
  29. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement