Hi,
It looks like you have a couple of issues going on, and you’re also doing a lot more work than you need to do.
The first issue is, when you use charCodeAt, the parameter you pass should be a position index. Since the string is only 14 characters long, this would be a number from 0 to 13. But instead, you are passing a[i], which is the character at that position . (For example, in the first iteration of the loop, you would have “str.charCodeAt(‘S’)” I’m not really sure what this does, but it’s not what you want.
You also have a misspelling fromCharCOde in one place (extra capital letter).
The extra work, is that you really don’t need to split the string into an array, since you are calling str.charCodeAt in any case. You also have some extra lines that don’t actually do anything (the first line in the else if block, and the first line in the else block.
I’m glad it was helpful! Believe me, everyone goes through that stage of making errors. Eventually you get it out of your system (until you start learning the next thing…) Good luck!