Guest User

Untitled

a guest
Nov 15th, 2018
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 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. "use strict";
  12.  
  13. ar = [5, 10, 3, 6, 999999, 10000000];
  14.  
  15. function aVeryBigSum(ar) {
  16. var theSum = ar.reduce(function (accumulator, currentValue) {
  17. return accumulator + currentValue;
  18. });
  19. return theSum;
  20. }
  21.  
  22. console.log(aVeryBigSum(ar));
  23. </script>
  24.  
  25.  
  26.  
  27. <script id="jsbin-source-javascript" type="text/javascript">ar = [5, 10, 3, 6, 999999, 10000000];
  28.  
  29. function aVeryBigSum(ar) {
  30. let theSum = ar.reduce((accumulator, currentValue) => accumulator + currentValue);
  31. return theSum;
  32. }
  33.  
  34.  
  35. console.log(aVeryBigSum(ar));</script></body>
  36. </html>
Add Comment
Please, Sign In to add comment