I have an array with the following when console.log(cMentions):
Object
41: "Never Ever"
43: "Steve Jobs"
55: "Henry Ford"
__proto__: Object
Then I have a textarea(id=”comment”) with:
Hello @Steve Jobs @Never Ever and friends
What I want to do is determine if the cMentions record are in the textarea value. If they are do X, if they are not do Y.
Use case. When this runs, it would notice that Henry Ford is not in the textarea and would remove it.
Ideas?
Thanks
Loop through each element, and check whether the name at the key exists in the string, using
.indexOf: