Skip to content

Commit a90c7f2

Browse files
authored
Merge pull request microsoft#748 from the1812/patch-1
Improved code in 'Modules'
2 parents bb8120c + b8dcd87 commit a90c7f2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pages/Modules.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,9 @@ class ProgrammerCalculator extends Calculator {
769769

770770
constructor(public base: number) {
771771
super();
772-
if (base <= 0 || base > ProgrammerCalculator.digits.length) {
773-
throw new Error("base has to be within 0 to 16 inclusive.");
772+
const maxBase = ProgrammerCalculator.digits.length;
773+
if (base <= 0 || base > maxBase) {
774+
throw new Error(`base has to be within 0 to ${maxBase} inclusive.`);
774775
}
775776
}
776777

0 commit comments

Comments
 (0)