@@ -139,31 +139,6 @@ console.log(b); // ?
139139
140140<!-- v -->
141141
142- ``` js [1-30]
143- // Create code for next conditions
144- function calculate () {
145- /* put your code here */
146- }
147- calculate (" +" )(1 )(2 ); // 3
148- calculate (" *" )(2 )(3 ); // 6
149- ```
150-
151- <!-- v -->
152-
153- ``` js [1-30]
154- // Create code for next conditions
155- let sum = function () {
156- /* put your code here */
157- };
158- let s = sum ();
159- alert (s ()); // 0
160- alert (s (1 )()); // 1
161- alert (s (1 )(2 )()); // 3
162- alert (s (3 )(4 )(5 )()); // 12
163- ```
164-
165- <!-- v -->
166-
167142``` js [1-30]
168143(function (x ) {
169144 return (function (y ) {
@@ -211,25 +186,6 @@ console.log(fnRes2()); //?
211186
212187<!-- v -->
213188
214- ``` js [1-30]
215- /*
216- - Do you understand the closure?
217- - Yes!
218- - Write a function, that does this next:
219- */
220- const func = (a , b , c , d , e ) => a + b + c + d + e;
221-
222- const hof = yourFunction (func);
223-
224- console .log (hof (1 , 2 , 3 , 4 , 5 )); // 15
225- console .log (hof (2 , 3 , 4 )(5 , 6 )); // 20
226- console .log (hof (3 , 4 )(5 , 6 )(7 )); // 25
227- console .log (hof (4 , 5 )(6 )(7 , 8 )); // 30
228- console .log (hof (5 )(6 )(7 )(8 )(9 )); // 35
229- ```
230-
231- <!-- v -->
232-
233189``` js [1-30]
234190var a = 1 ;
235191function b () {
@@ -377,91 +333,67 @@ console.log(a); // ?
377333
378334<!-- v -->
379335
380- ``` js [1-10]
381- // Define a
382- a == 1 && a == 2 && a == 3 ; // true
383- ```
384-
385- <!-- v -->
386-
387336``` js [1-30]
388- const fn = {};
389- function valueAccessor (value ) {
390- var accessor = function (newValue ) {
391- if (arguments .length === 0 ) {
392- return value;
393- }
394- value = newValue;
395- };
396- accessor .__proto__ = fn;
397- return accessor;
398- }
399- const a = valueAccessor (5 );
400- fn .incrementValue = function () {
401- this (this () + 1 );
337+ var foo = {
338+ bar : function () {
339+ return this .baz ;
340+ },
341+ baz: 1 ,
402342};
403- a .incrementValue ();
404- a (); // ?
343+ typeof (f = foo .bar )(); // ?
405344```
406345
407346<!-- v -->
408347
409348``` js [1-30]
410- // Update code for conditions
411- function A () {
412- this .value = 1 ;
413- }
414- const B = function () {};
415- /* put your code here */
416- const b = new B ();
417- b .value === undefined ; // should be true
418- b instanceof A ; // should be true
419- ```
420-
421- <!-- v -->
349+ /*
350+ - Do you understand the closure?
351+ - Yes!
352+ - Write a function, that does this next:
353+ */
354+ const func = (a , b , c , d , e ) => a + b + c + d + e;
422355
423- <!-- eslint-skip -->
356+ const hof = yourFunction (func);
424357
425- ``` js [1-20]
426- // create singleton
427- const getInstance = /* put your code here */
428- const o1 = getInstance ();
429- const o2 = getInstance ();
430- o1 instanceof User; // true
431- o1 === o2; // true
358+ console .log (hof (1 , 2 , 3 , 4 , 5 )); // 15
359+ console .log (hof (2 , 3 , 4 )(5 , 6 )); // 20
360+ console .log (hof (3 , 4 )(5 , 6 )(7 )); // 25
361+ console .log (hof (4 , 5 )(6 )(7 , 8 )); // 30
362+ console .log (hof (5 )(6 )(7 )(8 )(9 )); // 35
432363```
433364
434365<!-- v -->
435366
436- <!-- eslint-skip -->
437-
438- ``` js [1-20]
439- // create singleton
440- const User = /* your code */
441- const u1 = new User (1 );
442- const u2 = new User (2 );
443- u1 === u2; // true
367+ ``` js [1-30]
368+ // Create “native” methods Define a repeatify function on the String object.
369+ // The function accepts an integer that specifies how many times the string has to be repeated.
370+ // The function returns the string repeated the number of times specified. For example:
371+ console .log (" hello" .repeatify (3 )); // hellohellohello
444372```
445373
446374<!-- v -->
447375
448376``` js [1-30]
449- var foo = {
450- bar : function () {
451- return this .baz ;
452- },
453- baz: 1 ,
454- };
455- typeof (f = foo .bar )(); // ?
377+ // Create code for next conditions
378+ function calculate () {
379+ /* put your code here */
380+ }
381+ calculate (" +" )(1 )(2 ); // 3
382+ calculate (" *" )(2 )(3 ); // 6
456383```
457384
458385<!-- v -->
459386
460387``` js [1-30]
461- // Create “native” methods Define a repeatify function on the String object.
462- // The function accepts an integer that specifies how many times the string has to be repeated.
463- // The function returns the string repeated the number of times specified. For example:
464- console .log (" hello" .repeatify (3 )); // hellohellohello
388+ // Create code for next conditions
389+ let sum = function () {
390+ /* put your code here */
391+ };
392+ let s = sum ();
393+ alert (s ()); // 0
394+ alert (s (1 )()); // 1
395+ alert (s (1 )(2 )()); // 3
396+ alert (s (3 )(4 )(5 )()); // 12
465397```
466398
467399<!-- v -->
0 commit comments