Programming/JavaScript7 [JavaScript] Conditional Statements (조건문) 1. If statement ( ) 안에 true or false로 판단할 수 있는 조건 조건이 true이면 { } 내부 문장 실행 if (true) { console.log('This message will print!'); }// Output : This message will print! 2. If ... else statement 조건이 false이면 else 내부 문장 실행if (false) { console.log('The code in this block will not run.');} else { console.log('But the code in this block will!');}// Output : But the code in this block will! 3. Comparison.. 2024. 9. 25. [JavaScript] JavaScript 기초 1. Consoleconsole은 정보를 출력해주는 사용자 인터페이스다.console 객체의 .log( ) 메소드를 통해 console에 데이터를 출력할 수 있다. console.log( ) console.log(22); 2. Comments (주석)주석은 코드를 설명하기 위한 것으로, 프로그램 실행 시 무시된다.한 줄 주석 (single line comment) //여러 줄 주석, 코드 중간 주석 (multi line comment, middle of a line of code) /* */// single line comment/* multi line comment */ 3. Data Types (자료형)자료형은 프로그래밍에서 사용하는 다양한 종류의 데이터에 대한 분류이다. 자바스크립트에는 8가지 기본.. 2024. 9. 23. 이전 1 2 다음