We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 990e867 commit 70c1493Copy full SHA for 70c1493
js-core/homeworks/homework-7/src/main.js
@@ -92,6 +92,11 @@ function methodCounter(obj, name, num, fn) {
92
}
93
return `ERROR ! add more methods`
94
95
+ obj.addCounter = function(newNum, name){
96
+ name = 'addCounter'
97
+ counter = newNum
98
+ return [counter, name]
99
+ }
100
};
101
102
methodCounter(jun, 'logger', 2, function (args) {
@@ -104,7 +109,12 @@ console.log(jun.logger(1, 2, 3, 4)); // 2, 10
104
109
console.log(jun.logger(5, 5, 5, 5)); // 1, 20
105
110
console.log(jun.logger(5, 5)); // ERROR ! add more methods
106
111
107
-// jun.addCounter(10, methodName);
112
+console.log(jun.addCounter(10, name));
113
+console.log(jun.logger(1, 2, 3, 4)); // 2, 10
114
115
116
117
+
108
118
// @SUPER,
119
120
/*
0 commit comments