|
@@ -0,0 +1,47 @@
|
|
|
+// makeProfileTimer
|
|
|
+// function makeProfileTimer() {
|
|
|
+// var t1 = performance.now();
|
|
|
+// return function () {
|
|
|
+// var t2 = performance.now();
|
|
|
+// console.log(t2 - t1);
|
|
|
+// };
|
|
|
+// }
|
|
|
+// var timer = makeProfileTimer();
|
|
|
+// timer()
|
|
|
+
|
|
|
+// makeSaver
|
|
|
+// makeSaver = (fn) => {
|
|
|
+// var x = fn();
|
|
|
+// return (_) => x;
|
|
|
+// };
|
|
|
+
|
|
|
+// var saver = makeSaver(Math.random);
|
|
|
+// var value1 = saver();
|
|
|
+// var value2 = saver();
|
|
|
+// value1 === value2;
|
|
|
+
|
|
|
+// var saver2 = makeSaver(
|
|
|
+// () =>
|
|
|
+// console.log("saved function called") ||
|
|
|
+// [null, undefined, false, "", 0, Math.random()][Math.ceil(Math.random() * 6)]
|
|
|
+// );
|
|
|
+// var value3 = saver2();
|
|
|
+// var value4 = saver2();
|
|
|
+
|
|
|
+// value3 === value4;
|
|
|
+
|
|
|
+// Final Countdown
|
|
|
+// var obj = 6;
|
|
|
+// function timer() {
|
|
|
+// obj--;
|
|
|
+// if (obj == 0) {
|
|
|
+// console.log("поехали!");
|
|
|
+// obj.delete(0)
|
|
|
+// } else {
|
|
|
+// setTimeout(timer, 1000);
|
|
|
+// }
|
|
|
+// console.log(obj)
|
|
|
+// }
|
|
|
+// setTimeout(timer, 1000);
|
|
|
+
|
|
|
+
|