[Dart] 다트 언어 조건문 반복문


[Dart] 다트 언어 조건문 반복문

조건문 # if, if~else if (조건) { ... } if (조건) { ... } else { ... } --------- # switch switch(변수) { case 값1: ... break; case 값2: ... break; default: ... } --------- # assert(debug mode에서만 동작) 조건식이 거짓이면 에러 발생 main() { int a = 10; int b = 20; assert(a > b); // 거짓이므로 디버깅 모드에서 오류 발생 } 반복문 # for for (int i = 1; i < 5; i++) { ... } ---------- # while int a = 0; while(a < 5) { ... a++; } ---------- # do ~ while int a = 0; do { ... } while (a > 0);...


#dart #다트 #반복 #반복문 #조건 #조건문

원문링크 : [Dart] 다트 언어 조건문 반복문