From a14da3d113998876927df2812b0de95d02493441 Mon Sep 17 00:00:00 2001 From: Masahiko Shin Date: Sun, 23 May 2021 17:44:15 +0900 Subject: [PATCH] improve error handling of isDivisible --- Maths/IsDivisible.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maths/IsDivisible.js b/Maths/IsDivisible.js index 1cdb6137c..89ce0620e 100644 --- a/Maths/IsDivisible.js +++ b/Maths/IsDivisible.js @@ -2,7 +2,7 @@ export const isDivisible = (num1, num2) => { if (!Number.isFinite(num1) || !Number.isFinite(num2)) { - throw new Error('All parameters have to be numbers') + throw new TypeError("Expected a number") } if (num2 === 0) { return false