daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest May 16th, 2018 99 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.   <meta name="viewport" content="width=device-width">
  6.   <title>JS Bin</title>
  7. </head>
  8. <body>
  9.  
  10. <script id="jsbin-javascript">
  11. //Filter names starting with a "B"
  12. var names = ["Ben", "Bob", "John"];
  13. //console.log(names);
  14. var bNames = "";
  15. for (var i = 0; i < names.length; i += 1) {
  16.  if (names[i][0] === "B") {
  17.    bNames = names[i] + ", " + bNames;
  18.  }
  19. }
  20.  console.log(bNames.trim( ));
  21. </script>
  22.  
  23.  
  24.  
  25. <script id="jsbin-source-javascript" type="text/javascript">//Filter names starting with a "B"
  26. var names = ["Ben", "Bob", "John"];
  27. //console.log(names);
  28. var bNames = "";
  29. for (var i = 0; i < names.length; i += 1) {
  30.  if (names[i][0] === "B") {
  31.    bNames = names[i] + ", " + bNames;
  32.  }
  33. }
  34.  console.log(bNames.trim( ));</script></body>
  35. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top