+ 3

Is it possible to "dissect" an answer using javascript?

I was wondering if there was a way to find a variable within a given answer, for example if a variable is called "test" and someone answers a prompt with "thisisatest" the script would recognize the variable / word "test" within the answer, and perhaps even be able to execute a function. Sorry if my explanation might be confusing 😛

20th Apr 2017, 9:49 PM
iBrandon
iBrandon - avatar
2 ответов
+ 4
search for "test" in your input variable https://www.w3schools.com/jsref/jsref_search.asp
20th Apr 2017, 9:59 PM
seamiki
seamiki - avatar
+ 2
Thanks!
21st Apr 2017, 2:01 AM
iBrandon
iBrandon - avatar