Skip to content

Commit

Permalink
add solution for 1-module 1-task
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaltaphil committed Dec 2, 2024
1 parent 4d4c51b commit 2a7bb15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion 01-intro/01-sum/sum.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
export default function sum(a, b) {
/* ваш код */
if (
typeof a === "number" &&
isFinite(a) &&
typeof b === "number" &&
isFinite(b)
) {
return a + b;
}
throw new TypeError(`Expected two numbers`);
}

0 comments on commit 2a7bb15

Please sign in to comment.