Hi,
while i 'm working on the mini linter project, i came across the meaning " -1".
What does " -1 " means in general and in this context down below in task no. 5 in mini linter project?
Thank you in advance!
Now, count how many sentences are in the paragraph.
This may seem tricky, but remember that all of the sentences in this paragraph end with a period ( .
) or an exclamation mark ( !
). You could iterate over the array and add 1
to a sentence counter variable for each word that has a period or exclamation mark as its final character.
let sentences = 0;
array.forEach(word => {
if (word[word.length-1] === '.' || word[word.length-1] === '!') {
sentences+=1;
}
});