Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // BEGIN (write your solution here)
- const avr = (coll) => {
- if (coll === []) {
- return null;
- }
- let res = 0;
- for (const val of coll) {
- res += val;
- }
- res = res/coll.length;
- console.log(res);
- return res;
- }
- export default avr;
- // END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement