From 7850cf8f7bb58e2263df642c5085f61c2b5720f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AF=D0=BD=20=D0=9D=D0=B0=D0=B7=D0=BC=D0=B8=D0=B5=D0=B2?= Date: Tue, 11 Oct 2016 16:02:06 +0500 Subject: [PATCH 1/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=B5=D1=80=D0=B2=D1=8B=D0=B9=20=D0=B2=D0=B0?= =?UTF-8?q?=D1=80=D0=B8=D0=B0=D0=BD=D1=82=20=D1=80=D0=B5=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- math.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/math.js b/math.js index c749300..e5a766b 100644 --- a/math.js +++ b/math.js @@ -3,5 +3,5 @@ exports.isStar = true; exports.sum = function (a, b) { - // Реализуйте сложение в этой функции + return a + b; }; From dbd8ebe251abbdbb8d815b31cb18c18d3878504b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AF=D0=BD=20=D0=9D=D0=B0=D0=B7=D0=BC=D0=B8=D0=B5=D0=B2?= Date: Tue, 11 Oct 2016 16:23:53 +0500 Subject: [PATCH 2/4] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=B2=D1=82=D0=BE=D1=80=D0=BE=D0=B9=20=D0=B2=D0=B0?= =?UTF-8?q?=D1=80=D0=B8=D0=B0=D0=BD=D1=82=20=D1=80=D0=B5=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +Решение дополнительного задания --- math.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/math.js b/math.js index e5a766b..7640c21 100644 --- a/math.js +++ b/math.js @@ -5,3 +5,7 @@ exports.isStar = true; exports.sum = function (a, b) { return a + b; }; + +exports.sum = function (a, b, c) { + return a + b + c; +}; From ee05e3a4ee0a55d0db6a5ab6bf75b58222150ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AF=D0=BD=20=D0=9D=D0=B0=D0=B7=D0=BC=D0=B8=D0=B5=D0=B2?= Date: Tue, 11 Oct 2016 16:48:05 +0500 Subject: [PATCH 3/4] =?UTF-8?q?=D0=A2=D1=80=D0=B5=D1=82=D0=B8=D0=B9=20?= =?UTF-8?q?=D0=B2=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82=20=D1=80=D0=B5=D1=88?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлена конверсия типов --- math.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/math.js b/math.js index 7640c21..0db5a20 100644 --- a/math.js +++ b/math.js @@ -3,9 +3,9 @@ exports.isStar = true; exports.sum = function (a, b) { - return a + b; + return (+a) + (+b); }; exports.sum = function (a, b, c) { - return a + b + c; + return (+a) + (+b) + (+c); }; From c6247cb8fe0c00a33790313c3f5983ad351b71e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AF=D0=BD=20=D0=9D=D0=B0=D0=B7=D0=BC=D0=B8=D0=B5=D0=B2?= Date: Tue, 11 Oct 2016 16:54:19 +0500 Subject: [PATCH 4/4] =?UTF-8?q?=D0=A7=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D1=82?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=B2=D0=B0=D1=80=D0=B8=D0=B0=D0=BD=D1=82=20?= =?UTF-8?q?=D1=80=D0=B5=D1=88=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Явное преобразование типов через Number --- math.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/math.js b/math.js index 0db5a20..941008b 100644 --- a/math.js +++ b/math.js @@ -3,9 +3,9 @@ exports.isStar = true; exports.sum = function (a, b) { - return (+a) + (+b); + return Number(a) + Number(b); }; exports.sum = function (a, b, c) { - return (+a) + (+b) + (+c); + return Number(a) + Number(b) + Number(c); };