Title case a sentence, forEach and slice vs substring

By the way, I have some topic and there are 3 questions like ‘which of 2 options is the best’.
If you have time, would you be so kind to take a look? I refer only to the last post, where is working solution.
It’s here