Skip to content

Commit bea3492

Browse files
committed
Deleting the unreachable code and else form the last return
1 parent 80cde9a commit bea3492

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Sprint-3/2-practice-tdd/get-ordinal-number.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ function getOrdinalNumber(num) {
88
return num + "th";
99
} else if (num.slice(-1) === "1") {
1010
return num + "st";
11-
return num + "st";
1211
} else if (num.slice(-1) === "2") {
1312
return num + "nd";
1413
} else if (num.slice(-1) === "3") {
1514
return num + "rd";
16-
} else {
17-
return num + "th";
1815
}
16+
return num + "th";
1917
}
2018

2119
module.exports = getOrdinalNumber;

0 commit comments

Comments
 (0)