{"action":"created","issue":{"url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/4788","repository_url":"https://api.github.com/repos/da2k/curso-javascript-ninja","labels_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/4788/labels{/name}","comments_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/4788/comments","events_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/4788/events","html_url":"https://github.com/da2k/curso-javascript-ninja/issues/4788","id":327100000,"number":4788,"title":"[Challenge 29] Chamando função dentro de outra","user":{"login":"gabrielbahniuk","id":7410668,"avatar_url":"https://avatars3.githubusercontent.com/u/7410668?v=4","gravatar_id":"","url":"https://api.github.com/users/gabrielbahniuk","html_url":"https://github.com/gabrielbahniuk","followers_url":"https://api.github.com/users/gabrielbahniuk/followers","following_url":"https://api.github.com/users/gabrielbahniuk/following{/other_user}","gists_url":"https://api.github.com/users/gabrielbahniuk/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielbahniuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielbahniuk/subscriptions","organizations_url":"https://api.github.com/users/gabrielbahniuk/orgs","repos_url":"https://api.github.com/users/gabrielbahniuk/repos","events_url":"https://api.github.com/users/gabrielbahniuk/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielbahniuk/received_events","type":"User","site_admin":false},"labels":[{"id":195593100,"url":"https://api.github.com/repos/da2k/curso-javascript-ninja/labels/question","name":"question","color":"fbca04","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-28T19:09:59Z","updated_at":"2018-05-29T14:11:38Z","closed_at":"2018-05-29T13:43:43Z","author_association":"NONE","body":"Olá professor,\r\n\r\nestou fazendo um refactoring e gostaria que o código abaixo funcionasse:\r\n\r\n initTableElements : function initTableElements() {\r\n        var $fragment = document.createDocumentFragment();\r\n        var $imagem = document.createElement('img');\r\n        var $tbody = document.createElement('tbody');\r\n        var $linha = document.createElement('tr');\r\n        var $tdImagem = document.createElement('td');\r\n        var $tdMarca = document.createElement('td');\r\n        var $tdModelo = document.createElement('td');\r\n        var $tdPlaca = document.createElement('td');\r\n        var $tdAno = document.createElement('td');\r\n        var $tdCor = document.createElement('td');\r\n        this.appendFields();\r\n        return $fragment.appendChild($tbody);\r\n      },\r\n      appendFields : function appendFields() {\r\n        $tdImagem.appendChild($imagem);\r\n        $linha.appendChild($tdImagem);\r\n        $linha.appendChild($tdMarca);\r\n        $linha.appendChild($tdModelo);\r\n        $linha.appendChild($tdPlaca);\r\n        $linha.appendChild($tdAno);\r\n        $linha.appendChild($tdCor);\r\n        $tbody.appendChild($linha);\r\n        return $tbody;\r\n      }\r\n\r\nEstou chamando uma função dentro da outra, e está me retornando o erro $tdImagem is not defined, pois uma função não ta conseguindo acessar os atributos da outra.\r\n\r\nNão seria só executar o método do jeito que estou fazendo acima? Ou tem mais algo que deve ser feito?\r\n\r\nMinha ideia é fazer um InitTableElements, depois AppendFields...e ir quebrando em vários métodos até todos ficarem menores. Atualmente tenho o método InsertNewCar que está sobrecarregado de código e responsabilidades.\r\n\r\nObrigado.\r\n<!-- Não apague daqui pra baixo! -->\r\n@fdaciuk\r\n"},"comment":{"url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/comments/392791134","html_url":"https://github.com/da2k/curso-javascript-ninja/issues/4788#issuecomment-392791134","issue_url":"https://api.github.com/repos/da2k/curso-javascript-ninja/issues/4788","id":392791134,"user":{"login":"fdaciuk","id":487669,"avatar_url":"https://avatars2.githubusercontent.com/u/487669?v=4","gravatar_id":"","url":"https://api.github.com/users/fdaciuk","html_url":"https://github.com/fdaciuk","followers_url":"https://api.github.com/users/fdaciuk/followers","following_url":"https://api.github.com/users/fdaciuk/following{/other_user}","gists_url":"https://api.github.com/users/fdaciuk/gists{/gist_id}","starred_url":"https://api.github.com/users/fdaciuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdaciuk/subscriptions","organizations_url":"https://api.github.com/users/fdaciuk/orgs","repos_url":"https://api.github.com/users/fdaciuk/repos","events_url":"https://api.github.com/users/fdaciuk/events{/privacy}","received_events_url":"https://api.github.com/users/fdaciuk/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T14:11:38Z","updated_at":"2018-05-29T14:11:38Z","author_association":"MEMBER","body":"Legal! Qualquer coisa, só avisar =)"}}
{"actor":{"display_login":"fdaciuk"}}