Advertisement
Guest User

Untitled

a guest
Aug 16th, 2020
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. // BEGIN (write your solution here)
  2. const avr = (coll) => {
  3. if (coll === []) {
  4. return null;
  5. }
  6. let res = 0;
  7.  
  8. for (const val of coll) {
  9. res += val;
  10. }
  11. res = res/coll.length;
  12. console.log(res);
  13. return res;
  14. }
  15. export default avr;
  16. // END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement