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
  • 34,714
  • 9
  • 70
  • 166

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,922
  • 1
  • 11
  • 21