Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 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. const groceryList = ['orange juice', 'bananas', 'coffee beans', 'brown rice', 'pasta', 'coconut oil', 'plantains'];
  12.  
  13. groceryList.shift();
  14.  
  15. console.log(groceryList);
  16.  
  17. groceryList.unshift('popcorn');
  18.  
  19. console.log(groceryList);
  20.  
  21. console.log(groceryList.slice(1, 4));
  22.  
  23. console.log(groceryList);
  24.  
  25. const pastaIndex = groceryList.indexOf('pasta');
  26.  
  27. console.log(pastaIndex);
  28. </script>
  29.  
  30.  
  31.  
  32. <script id="jsbin-source-javascript" type="text/javascript">const groceryList = ['orange juice', 'bananas', 'coffee beans', 'brown rice', 'pasta', 'coconut oil', 'plantains'];
  33.  
  34. groceryList.shift();
  35.  
  36. console.log(groceryList);
  37.  
  38. groceryList.unshift('popcorn');
  39.  
  40. console.log(groceryList);
  41.  
  42. console.log(groceryList.slice(1, 4));
  43.  
  44. console.log(groceryList);
  45.  
  46. const pastaIndex = groceryList.indexOf('pasta');
  47.  
  48. console.log(pastaIndex);</script></body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement