From 95a7674ed654b4bc0397458d928d584d47e48652 Mon Sep 17 00:00:00 2001 From: "Siarhei.Kavalchuk" Date: Mon, 26 Dec 2016 12:04:06 +0300 Subject: [PATCH] new task more-than-one-call --- .../more-than-one-call/more-than-one-call.js | 3 +++ .../more-than-one-call_test.js | 8 ++++++++ katas/more-than-one-call/readme.md | 20 +++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 katas/more-than-one-call/more-than-one-call.js create mode 100644 katas/more-than-one-call/more-than-one-call_test.js create mode 100644 katas/more-than-one-call/readme.md diff --git a/katas/more-than-one-call/more-than-one-call.js b/katas/more-than-one-call/more-than-one-call.js new file mode 100644 index 0000000..7e03ed8 --- /dev/null +++ b/katas/more-than-one-call/more-than-one-call.js @@ -0,0 +1,3 @@ +function sum(a,b) { + +} diff --git a/katas/more-than-one-call/more-than-one-call_test.js b/katas/more-than-one-call/more-than-one-call_test.js new file mode 100644 index 0000000..070a1d7 --- /dev/null +++ b/katas/more-than-one-call/more-than-one-call_test.js @@ -0,0 +1,8 @@ +describe('sum function', function() { + + it('should return the sum of the numbers.', function() { + Test.expect(sum(2,3), 5); + Test.expect(sum(2)(3), 5); + Test.expect(sum(3)(3)(1), 7); + }); +}); diff --git a/katas/more-than-one-call/readme.md b/katas/more-than-one-call/readme.md new file mode 100644 index 0000000..2d4f2ee --- /dev/null +++ b/katas/more-than-one-call/readme.md @@ -0,0 +1,20 @@ +####Description: + +Write a single function that can be invoked by either + +####Example: + +```js + +sum(2,3); //5 +//or +sum(2)(3); //5 + +Both of these examples should return the sum of the numbers. +``` + +See [tests in more-than-one-call_test.js](https://github.com/AlexVvx/code-wars/blob/master/katas/more-than-one-call/more-than-one-call_test.js) + +#####[Original Kata](https://www.codewars.com/kata/547aadd5b84a1fd66800041e) + +Good luck