Ad
  • Custom User Avatar

    I ran your code and it yields the error below. Tests have been updated since, do find a pattern in doing such exponentations.

    TypeError: Cannot convert a BigInt value to a number
    at Math.pow ()
    at lastDigit (test.js:6:16)
    at doTest (test.js:14:20)
    at Context. (test.js:19:5)
    at process.processImmediate (node:internal/timers:471:21)

  • Custom User Avatar

    Because your regex only matches when there is at least one letter after the apostroph.