Why doesn’t the previous() function loop when the find term is the first word in a textarea?
I have a basic text editor where the user can search for a term in the text and navigate to the next or previous occurrence. The issue I’m facing is that when the search term is at the very beginning of the textarea
(e.g., the first word “Love”), pressing the “Previous” button doesn’t loop back to the last occurrence. However, this works fine if the search term is not at the start of the text (e.g., searching for the term “never”).
Long Strings In JS Issue [closed]
Closed 28 mins ago.
Long Strings In JS Issue [closed]
Closed 28 mins ago.
Want to detect all the words in the string
So ive written a code which would detect all the words that are there in a sentence. I would only detect the words and would ignore the spaces, which means even if there are empty spaces in the string i would not count them. But the result are not what i expected. Here is the code :