From 434ad547c8b6d30c3a1fd233baf458a59a8a2ffa Mon Sep 17 00:00:00 2001 From: Michael Sankovich Date: Thu, 11 Jun 2015 14:54:39 -0700 Subject: [PATCH 1/5] solved problem --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9bb9cd7..3c176c1 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ var doubler = function(a, b) { + var double = (a + b)*2 + return double; } - console.assert(doubler(4,2) === 12); console.assert(doubler(1,3) === 8); console.assert(doubler(-1,3) === 4); From fceae546dd9d0ecf3642ed754a0f0f104b5caf7e Mon Sep 17 00:00:00 2001 From: Michael Sankovich Date: Thu, 11 Jun 2015 16:12:50 -0700 Subject: [PATCH 2/5] finally done --- index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/index.js b/index.js index b6ba2b2..a1193d4 100644 --- a/index.js +++ b/index.js @@ -20,3 +20,15 @@ function m1() { return 1; } console.assert(doubler(m4, m2) === 12); console.assert(doubler(m1, m3) === 8); + +function objectsEqual() { + return a.t + a.z === b.t + b.z +} + +var a = { z: 42 , t: 7 }, b = { t: 7, z: 42 } + +objectsEqual(doubler({x1: 1, x2: 4}), {x1: 2, x2: 8}); +objectsEqual(doubler({x1: -4, x2: 0}), {x1: -8, x2: 0}); + +console.assert(objectsEqual(a, b)); +console.assert(objectsEqual(b, a)); From be1ac91ad80f6026eafbdbf844a8bfee490e55d4 Mon Sep 17 00:00:00 2001 From: Michael Sankovich Date: Thu, 11 Jun 2015 16:44:09 -0700 Subject: [PATCH 3/5] finally done --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a1193d4..e9859db 100644 --- a/index.js +++ b/index.js @@ -27,8 +27,8 @@ function objectsEqual() { var a = { z: 42 , t: 7 }, b = { t: 7, z: 42 } -objectsEqual(doubler({x1: 1, x2: 4}), {x1: 2, x2: 8}); -objectsEqual(doubler({x1: -4, x2: 0}), {x1: -8, x2: 0}); - console.assert(objectsEqual(a, b)); console.assert(objectsEqual(b, a)); + +console.assert(objectsEqual(doubler({x1: 1, x2: 4}), {x1: 2, x2: 8})); +console.assert(objectsEqual(doubler({x1: -4, x2: 0}), {x1: -8, x2: 0})); From 64e62472f1c6e630e55ecb297ef5439fdd1960d5 Mon Sep 17 00:00:00 2001 From: Michael Sankovich Date: Thu, 11 Jun 2015 17:31:03 -0700 Subject: [PATCH 4/5] good luck --- tdd2.js | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tdd2.js diff --git a/tdd2.js b/tdd2.js new file mode 100644 index 0000000..64798f5 --- /dev/null +++ b/tdd2.js @@ -0,0 +1,8 @@ +function power (a, b, c) { + +} + + +console.assert(fixer(3, 9, 2) === 531441); +console.assert(fixer(2, 4, 7) === 5764801); +console.assert(fixer(.5, 4, 13) === 169); From 84eadaf7f7b8999bc18de996657080cc4ceca529 Mon Sep 17 00:00:00 2001 From: Michael Sankovich Date: Thu, 11 Jun 2015 17:33:05 -0700 Subject: [PATCH 5/5] sorry, this one Samer --- tdd2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tdd2.js b/tdd2.js index 64798f5..9a1b03d 100644 --- a/tdd2.js +++ b/tdd2.js @@ -1,4 +1,4 @@ -function power (a, b, c) { +function fixer(a, b, c) { }