졸꾸 코딩일기 21.6.21

David K·2021년 6월 21일
0

졸꾸 코딩일기 2021

목록 보기
6/31

건강관리

  • 산책 V
  • 스트레칭 V

코딩기록

계산기 과제에서 어드벤스 레벨을 드디어 과제의 의도대로 풀어가기 시작했다!!
매우매우 기쁘다. 오늘도 인증.
반드시 나이트메어 레벨까지 완전히 풀고 싶다

buttons.addEventListener('click', function (event) {
  const target = event.target; 
  const action = target.classList[0]; 
  const buttonContent = target.textContent; 

  if (target.matches('button')) {
    if (action === 'number') {
       if(aNum === undefined){
         display.textContent = buttonContent
         aNum = buttonContent
       }else{
        display.textContent = display.textContent + buttonContent
       }
    }

    if (action === 'oper') {
      aNum = undefined
      bNum = display.textContent
      operatorAdv = buttonContent
    }

    if (action === 'cal') {
       cKey = display.textContent
       display.textContent = calculate(bNum, operatorAdv, cKey)
    }
  }
});
profile
배워서 남 주자

0개의 댓글

관련 채용 정보