inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

qwui1님의 게시글

qwui1 qwui1

@rkdguswns08038411

수강평 작성수
-
평균평점
-

게시글 3

질문&답변

경고메세지 질문있습니다.

확인을 해보니 reducers/post.js의 dummyPost부분에서 id에 shortId.generate(), 를 적용시켰을때 경고 메세지가 뜨는 것 같습니다. id: 2, 처럼 숫자로 지정하면 경고메세지가 나오지 않습니다. 해결방법이 따로 있을까요 아니면 그냥 넘어가도 될만한 부분일까요?

좋아요수
1
댓글수
2
조회수
314

질문&답변

9강 컴퓨터의 턴 버그 질문

if (turn === 'X') { clickable = false; setTimeout(() => { const emptyCells = rows.flat().filter((v) => !v.textContent); const randomCell = emptyCells[Math.floor(Math.random() * emptyCells.length)]; randomCell.textContent = 'X'; checkWinnerAndDraw (event.target) ; clickable = true; }, 1000); } 보여주신 코드와 비교했을 때 표시한 부분이 달라서 정상적으로 작동하지 않았습니다. 가장 큰 원인은 event.target을 randomCell로 바꾸지 않은 부분인 듯합니다. 강의에서는 위의 코드로 마무리 되어 제가 놓친 것 같습니다. 감사합니다.

좋아요수
0
댓글수
2
조회수
273

질문&답변

numOne을 음수로 시작하기

아래의 코드를 추가하여 원하는 결과는 얻어내었습니다. (2021-10-27) const onClickNumber = ( event ) => { if (! operator ) { numOne += event . target . textContent ; $result . value += event . target . textContent ; return ; } if (! numOne ) { numOne += event . target . textContent * - 1 ; $result . value += event . target . textContent * - 1 ; operator = '' ; $operator . value = '' ; return ; } if (! numTwo ) { $result . value = '' ; } numTwo += event . target . textContent ; $result . value += event . target . textContent ; };

좋아요수
0
댓글수
3
조회수
466