We're a place where coders share, stay up-to-date and grow their careers.
It would, indeed. Thanks for pointing out. Now I have fixed it and added a new test case.
OLD SOLUTION (Line 7)
const suffix = Math.floor(cent / 10) === 1 ? 'th'
UPDATED SOLUTION (Line 7)
const suffix = Math.floor(cent / 10) % 10 === 1 ? 'th'
It would, indeed. Thanks for pointing out. Now I have fixed it and added a new test case.
OLD SOLUTION (Line 7)
UPDATED SOLUTION (Line 7)