Functions call functions js

JavaScript
function addfunc(a, b) {
  return a + b;
  // standard long function
}

addfunc = (a, b) => { return a + b; }
// cleaner faster way creating functions!
/*
Write a function sum that takes an array of numbers and 
returns the sum of these numbers. 
Write a function mean that takes an array of numbers and 
returns the average of these numbers. 
The mean function should use the sum function.
*/
function sum (arr) {
    let suma = 0;
    for (let i = 0; i < arr.length; i++) {
        
        let num= parseInt(arr[i]);
        suma += num;
    }
    return suma;
  }
  
  function mean (arr) {
    let average = sum(arr) /arr.length;
    
    return average;
  }
Source

Also in JavaScript: