Advertisement
DerioFT

Challenge 02 Hacker Speak

Sep 4th, 2021
1,221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <title>Hacker Speak</title>
  6. </head>
  7. <body>
  8.     <script type="text/javascript">
  9.         var output = "";
  10.  
  11.         var input = "javascript is awesome";
  12.        
  13.  
  14.         for (text = 0; text < input.length; text++){
  15.             if (input[text] == "a"){
  16.                 output += "4";
  17.             } else if (input[text] == "e"){
  18.                 output += "3";
  19.             } else if (input[text] == "i"){
  20.                 output += "1";
  21.             } else if (input[text] == "o"){
  22.                 output += "0";
  23.             } else{
  24.                 output += input[text]
  25.             }
  26.         }
  27.         console.log(output);
  28.     </script>
  29. </body>
  30. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement