공부단 3일차-1입니다. if문 사용법 if(조건) { // 조건이 true일 경우 } else { // 조건이 false일 경우 } 3의 배수 구하기 var num = prompt("숫자를 입력하세요") // document.write(typeof(num)) // string if(num != null) { num = parseInt(num) if(num % 3 == 0) document.write("3의 배수") else document.write("3의 배수가 아님") } else { alert("취소") } prompt로 입력받은 것은 string형이기 때문에 parseInt()로 정수형으로 변환해줘야 합니다. 조건연산자 // 조건 ? 조건이 true일 경우 : 조건이 false일 경우 var s..