{"action":"closed","issue":{"url":"https://api.github.com/repos/redexp/geekhub-2016-js/issues/7","repository_url":"https://api.github.com/repos/redexp/geekhub-2016-js","labels_url":"https://api.github.com/repos/redexp/geekhub-2016-js/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/redexp/geekhub-2016-js/issues/7/comments","events_url":"https://api.github.com/repos/redexp/geekhub-2016-js/issues/7/events","html_url":"https://github.com/redexp/geekhub-2016-js/issues/7","id":189241426,"number":7,"title":"Незрозумілий принцип роботи setTimeout()  в поєднанні з each().","user":{"login":"denys991","id":22910972,"avatar_url":"https://avatars.githubusercontent.com/u/22910972?v=3","gravatar_id":"","url":"https://api.github.com/users/denys991","html_url":"https://github.com/denys991","followers_url":"https://api.github.com/users/denys991/followers","following_url":"https://api.github.com/users/denys991/following{/other_user}","gists_url":"https://api.github.com/users/denys991/gists{/gist_id}","starred_url":"https://api.github.com/users/denys991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denys991/subscriptions","organizations_url":"https://api.github.com/users/denys991/orgs","repos_url":"https://api.github.com/users/denys991/repos","events_url":"https://api.github.com/users/denys991/events{/privacy}","received_events_url":"https://api.github.com/users/denys991/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-14T22:12:58Z","updated_at":"2016-11-15T05:59:25Z","closed_at":"2016-11-15T05:59:25Z","body":"Є така задача:\r\nДаны текстовые инпуты. Первому поставьте текст 1, через секунду второму поставьте текст 2, еще через секунду третьему текст 3 и так далее.\r\n\r\nЯ її зробив таким чином і все працює:\r\n``` javascript\r\n$('input').each(function (i, elem) {\r\n    setTimeout(function() {\r\n        $(elem).val(i+1);\r\n    }, i*1000);\r\n})\r\n```\r\n\r\nАле не зрозуміло чому не працює без примноження часу затримки на ```i```?\r\nІ чи є більш раціональні прийоми використання ```setTimeout()``` з ```each() ```?"}}
{"actor":{"display_login":"redexp"}}