matheus-rodrigues00 / utils

✨ Library to commonly used cross-projects utilities methods ✨
17 stars 11 forks source link

Create mean Method at numbers.ts #52

Closed matheus-rodrigues00 closed 1 year ago

matheus-rodrigues00 commented 1 year ago

Develop a new method called mean. This method should calculate the mean (average) value of an array of numbers.

const numbers = [1, 2, 3, 4, 5];
const average = mean(numbers);
console.log(average); // Should return 3

The implementation should include robust type definitions for optimal usability.