This is about the title case algorithm which I extended further. I need the most efficient implementation in JavaScript. It should be extensible and scalable.
For example, I have a random array such as:
var arr = ["hell o", "3are", "you a","modern","332developer"];
If the element contents start with a number then it should ignore that index and move to the next index until it finds an initial letter and convert it to upper case. The remaining letters in the word should be in lower case. If there is space after a word in the content then it should consider that a new word and apply the same logic of applying upper case to that letter.
The results should be as below:
var arr = ["Hell O", "3Are", "You A","Modern","332Developer"];