diff --git a/01-intro/01-sum/sum.js b/01-intro/01-sum/sum.js index c45d4c3..d7ec502 100644 --- a/01-intro/01-sum/sum.js +++ b/01-intro/01-sum/sum.js @@ -1,3 +1,7 @@ export default function sum(a, b) { - /* ваш код */ + if (typeof a != 'number' || typeof b != 'number') { + throw new TypeError("Arguments must be numbers"); + } + + return a + b; }