Mini Linter Step 5 Question

So I just wanted to get someone to look at the code I wrote for step 5 of the Mini Linter portion of the learn-iterators section. My code differs from the solution given, but not by a lot. I just want to know if this code has a problem, or if its acceptable??

let storySplit = story.split(’’);
let sentenceCount = 0;
storySplit.forEach(mark => {
if (mark === ‘.’ || mark === ‘!’)
sentenceCount += 1;

I split the entire story to individual characters, and then ran a forEach to check for the specific punctuation. The solution ran a word.length-1. Does my code work just the same, or will it create errors?

let sentences = 0;
array.forEach(word => {
if (word[word.length-1] === ‘.’ || word[word.length-1] === ‘!’) {

Is it equivalent? Do you make the same comparisons?
If it’s not equivalent, do you care about the difference?
What do you specifically care about, and do both versions do that? Could you show them carrying that out by printing what is being done? Does any of them do more things than that? Is that okay, or should the extra actions be discarded? Does any of them do less, could it miss something, what would it miss?

Maybe you’d want to instead describe them in english and compare the methods rather than the code. After you’ve decided which method(s) are acceptable, you can move on to whether their implementations are correct. That’s a separate problem from deciding on whether the method is acceptable.