Tell us what’s happening:
So, the problem I’m having is for some reason the method I’m using isn’t going true when it should be. The problem calls for you to detect when the strings in arr[1] hold the same letters as arr[0]. So I made use of new RegExp to make a dynamic proof to be used. I used the wildcard period just so that it would look for anything that as any combination of the letters and the g and i tags so that it would reiterate and not be hampered by case identification. Despite this though, its still hampered by the case differences. It produces false well enough though, anything that’s suppose to be false seems to come out as expected. I’m beginning to think that all I made was a false machine.
Your code so far
function mutation(arr) {
let tester = arr[0];
let stringer = arr[1];
let wall = new RegExp(tester+".","gi");
let work =wall.test(stringer)
return work;
}
mutation(["hello", "hey"]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
.
Challenge: Mutations
Link to the challenge: