Created
January 5, 2015 01:45
-
-
Save jbailey4/e179b4167a4aa28b1738 to your computer and use it in GitHub Desktop.
ES6 average function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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