작성
·
43
·
수정됨
0
아래와 같이 코드를 작성했을 때,
화면에 출력되는 sum(2,3) 의 값은 5인데
sumColorRed(2,3)의 값은 왜 더해지지 않고 23으로 출력되는걸까요?
function sum(left, right){
document.write(left+right+'<br>')
}
function sumColorRed(left, right){
document.write('<div style="color:red">'+left+right+'</div>')
}
sum(2,3); // 5
sumColorRed(2,3); // 5
답변