const average = (...nums: Array<number>) =>
        nums.reduce((acc, val) => acc + val, 0) / nums.length;
      

      Typescript language logo
      Average of two numbers

      Codiga's TypeScript Recipes

      Calculates the average of two or more numbers.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.