Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <meta http-equiv="X-UA-Compatible" content="ie=edge" />
- <title>Zad 01</title>
- <script>
- var taskete = 1;
- var handler = function(count) {
- var caller = arguments.callee;
- //Infinite
- if (count == -1) {
- window.setTimeout(function() {
- console.log(taskete);
- taskete++;
- caller(count);
- }, 1000);
- }
- if (count > 0) {
- if (count == 0) return;
- console.log(taskete);
- taskete++;
- window.setTimeout(function() {
- caller(count - 1);
- }, 100);
- }
- if (count == null) {
- console.log(taskete);
- taskete++;
- }
- };
- handler(10);
- </script>
- </head>
- <body></body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement