"조건문"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
7번째 줄: 7번째 줄:


==예시==
==예시==
<source lang='javascript'>
<syntaxhighlight lang='javascript'>
<script>
<script>
var a = 2;
var a = 2;
18번째 줄: 18번째 줄:
}
}
</script>
</script>
</source>
</syntaxhighlight>
<jsfiddle>ad91whhm</jsfiddle>
<jsfiddle>ad91whhm</jsfiddle>



2022년 7월 11일 (월) 15:51 판

1 개요

conditional statement, conditional expression, conditional construct, conditional
조건문, IF문
  • 조건이 참인지 거짓인지에 따라 달라지는 계산이나 상황을 프로그래밍 구조

 

2 예시

<script>
var a = 2;
var b = 5;
if( a == b ) {
    document.write('a와 b는 같다.');
}
else {
    document.write('a와 b는 같지 않다.');
}
</script>

3 같이 보기

4 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}