Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>JS Bin</title>
- </head>
- <body>
- <script id="jsbin-javascript">
- "use strict";
- ar = [5, 10, 3, 6, 999999, 10000000];
- function aVeryBigSum(ar) {
- var theSum = ar.reduce(function (accumulator, currentValue) {
- return accumulator + currentValue;
- });
- return theSum;
- }
- console.log(aVeryBigSum(ar));
- </script>
- <script id="jsbin-source-javascript" type="text/javascript">ar = [5, 10, 3, 6, 999999, 10000000];
- function aVeryBigSum(ar) {
- let theSum = ar.reduce((accumulator, currentValue) => accumulator + currentValue);
- return theSum;
- }
- console.log(aVeryBigSum(ar));</script></body>
- </html>
Add Comment
Please, Sign In to add comment