This commit is contained in:
Ilya Kantor 2019-05-19 19:38:16 +03:00
parent dd106baf4c
commit 00d8b63110

View file

@ -4,7 +4,7 @@ importance: 4
# Get average age
Write the function `getAverageAge(users)` that gets an array of objects with property `age` and gets the average.
Write the function `getAverageAge(users)` that gets an array of objects with property `age` and returns the average age.
The formula for the average is `(age1 + age2 + ... + ageN) / N`.
@ -19,4 +19,3 @@ let arr = [ john, pete, mary ];
alert( getAverageAge(arr) ); // (25 + 30 + 29) / 3 = 28
```