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