We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ac1333 commit 3d45d8aCopy full SHA for 3d45d8a
1 file changed
Sprint-3/2-practice-tdd/get-ordinal-number.js
@@ -3,6 +3,10 @@ function getOrdinalNumber(num) {
3
if (typeof num !== "number" || Number.isNaN(num)) {
4
throw new TypeError("Input must be a number");
5
}
6
+ // Strict: only allow integers
7
+ if (!Number.isInteger(num)) {
8
+ throw new TypeError("Input must be an integer");
9
+ }
10
11
const abs = Math.abs(num);
12
const lastTwoDigits = abs % 100;
0 commit comments