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