0

It is necessary in the operator to compare whether the text contains the value "100" in the answer should be god = 10

function myFunctiontest566() {
 var god = 16;
 var test = "test 100 pups"
 if(test == "*100*") {var god = 10;}
 }
Rubén
  • 29,320
  • 9
  • 61
  • 145

1 Answers1

0

What you need is indexOf

function myFunctiontest566() {
 var god = 16;
 var test = "test 100 pups"
 if(test.indexOf("100")>-1) {var god = 10;}
 }
J. G.
  • 1,823
  • 1
  • 10
  • 20