There's a problem with this exercise is it doesn't address the problem when there are other words in text which also start with the same letter as myName.
var text = "Hello Jim. Jim likes Jelly Beans. Good bye Jim!";
Then the output is [ 'J', 'i', 'm', 'J', 'i', 'm', 'J', 'e', 'l', 'J', 'i', 'm' ].