forked from dgdang97/jax-ftd-day-7-javascript-kata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlib.js
29 lines (26 loc) · 765 Bytes
/
lib.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
TODO: Implement empty function bodies according to their requirements
*/
function createGrowthModel (lengthToWingspan, leavesEatenToWeight) {
return {
lengthToWingspan,
leavesEatenToWeight
}
}
/**
* Given an array of growth models, this function finds their average and returns
* this result as a new growth model object
*
* @param growthModels [Array<GrowthModel>] the growth models to average.
* If empty or undefined, return
* an undefined growth model
*
* @return a GrowthModel object
*/
function averageGrowthModel (growthModels) {
// TODO: implement using Array.prototype.reduce()
}
module.exports = {
createGrowthModel,
averageGrowthModel
}