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.

Yevhen Horbunkov
  • 14,965
  • 3
  • 20
  • 42

0 Answers0