Created
February 16, 2017 19:35
-
-
Save outoftime/a6a69939f2288a6ecbefb60e84152a31 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=a6a69939f2288a6ecbefb60e84152a31
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Page Title</title> | |
</head> | |
<body> | |
</body> | |
</html> |
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
{"enabledLibraries":["jquery"]} |
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
var tiers = [10, 15, 20, 25, 30, 35, 40]; | |
var extraGrowth = 1; | |
var numerator = 0; | |
var denominator = 0; | |
for (var i = 0; i < tiers.length; i++) { | |
var multiplier = i === extraGrowth ? 1.2 : 1.1; | |
numerator += tiers[i] * multiplier; | |
denominator += multiplier; | |
} | |
$(document.body).append('The weighted average growth rate is ' + numerator / denominator); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment