Skip to content
Advertisement

Calculate average the letter length of a phrase with one function

I did this programming to calculate the average letters of a phrase. Do you think this program is responsible for all texts? And do you have a better offer? Thanks

JavaScript

Advertisement

Answer

Alternatively, this program can be simplified to this function: Your original program just make it overly complex.

JavaScript

Running it:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement