Skip to content

Instantly share code, notes, and snippets.

@jbailey4
Created January 5, 2015 01:45
Show Gist options
  • Save jbailey4/e179b4167a4aa28b1738 to your computer and use it in GitHub Desktop.
Save jbailey4/e179b4167a4aa28b1738 to your computer and use it in GitHub Desktop.
ES6 average function
function average(...args) {
var sum = args.reduce((x, y) => x + y, 0);
return sum / args.length;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment