This is weird... I simply can't figure it out:
var word = "hello";
var re = new RegExp("hello", "g");
alert(re.test(word));
if (re.test(word)) {
alert("seems to work fine");
} else
alert("This message is not supposed to pop up, because the if-statement above is (beyond even the slightest of any doubts): " + re.test(word));
Aucun commentaire:
Enregistrer un commentaire