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], ] ], ] 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;