From f7f647d0e9f96e27ce800b7ef0417f3b045702da Mon Sep 17 00:00:00 2001 From: Tima Gixe Date: Sun, 22 Jan 2023 19:36:48 +0200 Subject: [PATCH 1/2] Extend tests of 4-methods --- Exercises/4-methods.test | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Exercises/4-methods.test b/Exercises/4-methods.test index a408b22..78eb07d 100644 --- a/Exercises/4-methods.test +++ b/Exercises/4-methods.test @@ -10,11 +10,15 @@ }, m3(x, y, z) { return [x, y, z]; - } + }, + m4: function sum(x, y) { + return x + y; + }, }, [ ['m1', 1], ['m2', 2], - ['m3', 3] + ['m3', 3], + ['sum', 2], ] ], ] From f6bedefc26984aeaf731f669fadd136ad32f217f Mon Sep 17 00:00:00 2001 From: Tima Gixe Date: Sun, 22 Jan 2023 19:36:59 +0200 Subject: [PATCH 2/2] Update solution of 4-methods --- Solutions/4-methods.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Solutions/4-methods.js b/Solutions/4-methods.js index 53ec1aa..46890b3 100644 --- a/Solutions/4-methods.js +++ b/Solutions/4-methods.js @@ -5,7 +5,7 @@ const methods = (iface) => { for (const name in iface) { const fn = iface[name]; if (typeof fn === 'function') { - names.push([name, fn.length]); + names.push([fn.name, fn.length]); } } return names;