0

Is there any difference between the two regexes?

  isFunctionKey(funKey) {
  return /^('funKey')|([01][1-9]|2[0-4])$/.test(funKey);
  }

and

 isFunctionKey(funKey) {
    return /^(funKey)|([01][1-9]|2[0-4])$/.test(funKey);
  }

HINT: Look into return statement funkey; one is in quotes and the other is not.

Yevgen Gorbunkov
  • 12,646
  • 3
  • 13
  • 31

0 Answers0