Browse Source

done small fix

unknown 2 năm trước cách đây
mục cha
commit
d6fa4e5dc4
1 tập tin đã thay đổi với 4 bổ sung6 xóa
  1. 4 6
      javascript/hw.js

+ 4 - 6
javascript/hw.js

@@ -2,14 +2,13 @@
 
 //Замыкания
 
-const makeProfileTimer = (cb) => {
+const makeProfileTimer = () => {
 	const start = performance.now();
-	cb();
 	return () => performance.now() - start;
 };
-const timer = makeProfileTimer(() =>
-	alert('Замеряем время работы этого alert')
-);
+
+const timer = makeProfileTimer();
+alert('Замеряем время работы этого alert');
 alert(timer());
 
 const makeSaver = (value) => () => value;
@@ -30,7 +29,6 @@ console.log(value3 === value4, 'value3 === value4'); // тоже должно б
 (function selfCountDown(n) {
 	if (n === 0) return;
 	setTimeout(() => {
-		console.log(n);
 		selfCountDown(n - 1);
 	}, 1000);
 })(5);