Skip to content

Instantly share code, notes, and snippets.

@hoppula
Last active December 22, 2015 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoppula/6433604 to your computer and use it in GitHub Desktop.
Save hoppula/6433604 to your computer and use it in GitHub Desktop.
function (input) {
return Math.max.apply(Math, input.split('').map(Number).map(function(num, index, arr) {
return arr.slice(index, index+5).reduce(function(memo, num) {
return memo * num;
}, 1);
}, 0));
}
@terotil
Copy link

terotil commented Sep 4, 2013

Certainly way better than mine (return 28224;). This IMO illustrates clearly the difference a syntax can make. Just compare to https://gist.github.com/terotil/6434553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment