์ด๊ฒ์ ์น ์ฌ์ดํธ์ ๊ดํ ๊ฒ์
๋๋ค.
ํ์ด์ง: https://lostisland.github.io/faraday/team/
์คํผ๋๊ฐ ๋จ์ ์์ต๋๋ค. ์ฝ์์ team.js ํ์ผ์ ๋ํ JS ์ค๋ฅ๊ฐ ํ์๋ฉ๋๋ค.
๊ฐ์ ธ์จ ๋ฐ์ดํฐ ํ์ด์ง์ ์ ๋ณด ๊ตฌ์กฐ๊ฐ ๋ณ๊ฒฝ๋์์ ์ ์์ต๋๊น?
์ ๋ ํ์ด์ดํญ์ค๋ฅผ ์ฌ์ฉํ๊ณ ์์์ต๋๋ค.
ํ์ด์ง๋ก ์ด๋: https://lostisland.github.io/faraday/team/
์ฝ์ ์ด๊ธฐ;
Uncaught (in promise) TypeError: json.findIndex is not a function
innerHTML https://lostisland.github.io/faraday/assets/js/team.js:16
fetchTeam https://lostisland.github.io/faraday/assets/js/team.js:15
<anonymous> https://lostisland.github.io/faraday/assets/js/team.js:43
ํด๋น ๊ธฐ๋ฅ์ ์ฝ๋๋
function fetchTeam(json, team, div) {
let el = document.querySelector(div);
el.innerHTML = team.map(function (m) {
let index = json.findIndex(function(e) {
return e.author.login === m
});
return teamTile(json.splice(index, 1)[0]);
}).join('');
}
๋ฐฉ๊ธ ์๋ํ๋๋ฐ ์ ์๋ํฉ๋๋ค. ์๋ง๋ ์ผ์์ ์ธ ๋ฌธ์ ์์๊น์?
ํฐ์ผ๋ก ํด๋ดค๋๋ฐ ์คํผ๋๋ง ๋์๋ค์. ํ !
์ด์ ํฉ๋๋ค. MDN์ ๋ฐ๋ฅด๋ฉด ์ด ๊ธฐ๋ฅ์ Firefox์์๋ ์ง์๋์ด์ผ ํฉ๋๋ค ๐ค
_์ง๊ธ_ ๋ด ๋ ธํธ๋ถ์์ ์๋ฒฝํ๊ฒ ์๋ํ์ต๋๋ค. ํ .
...๊ทธ๋ฆฌ๊ณ ๋ด ์ ํ์. ํ . ํ์!