console.log and comments · console.log 및 주석
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version. · 이 페이지는 최신 브라우저(SharedArrayBuffer 지원)가 필요합니다. Chrome, Edge, Firefox 또는 Safari를 최신 버전으로 업데이트해 주세요.
English
The language of the web
- JavaScript runs inside every web browser. It makes pages do things — buttons, games, maps, chat.
console.log(...)prints a message to the console, a window for text output.- Anything after
//is a comment. JavaScript ignores it — it is a note for humans reading the code.
한국어
웹의 언어
- JavaScript는 모든 웹 브라우저 내에서 실행됩니다. 페이지가 작동하게 만듭니다 — 버튼, 게임, 지도, 채팅 등.
- **
console.log(...)**는 메시지를 콘솔(console) 에 출력합니다. 텍스트 출력을 위한 창입니다. - **
//**后面的 everything is a 주석(comment). JavaScript는 무시합니다 — 코드 코드를 읽는 사람을 위한 메모입니다.
console.log("Hello, world!"); // → Hello, world!
// this whole line is a comment — it does nothing
English
Print text, numbers, or both
- Text goes inside quotes:
"hello". Numbers do not:42. - Pass several items separated by commas — they print on one line, with a space between.
한국어
텍스트, 숫자, 또는 둘 다 출력하기
- 텍스트는 따옴표 안에 넣습니다:
"hello". 숫자는 그렇지 않습니다:42. - 쉼표로 여러 항목을 전달하십시오 — 한 줄에 출력되며, 사이에는 공백이 있습니다.
console.log("Score:", 42); // → Score: 42
console.log(3 + 4); // → 7
English
Watch out
- Text needs quotes.
console.log(Hello)is an error — JavaScript hunts for something namedHello. - End each statement with a semicolon
;. It is a good habit, even where JavaScript would forgive you.
한국어
주의사항
- 텍스트는 따옴표가 필요합니다. **
console.log(Hello)**는 오류(error) 입니다 — JavaScript는 **Hello**이라는 이름의 무언가를 찾아냅니다. - 각 문장末尾에 세미콜론 **
;**로 마칩니다. JavaScript가 용서할 수 있는 곳에서도 좋은 습관입니다.
English
Common mistakes
console.log(...)prints; text needs quotes.//starts a comment.
한국어
흔한 실수
- **
console.log(...)**는 출력합니다; 텍스트는 따옴표가 필요합니다. - **
//**는 주석을 시작합니다.
English
Now you try
- Use
console.log(...)to print. - Press Run to see the output, then Check answer.
한국어
이제 직접 해보기
- 출력을 위해 **
console.log(...)**를 사용하십시오. - 출력을 보려면 Run을 누른 후 Check answer를 누릅니다.
Use console.log(...) to print the word Hello. · console.log(...)을 사용하여 단어 Hello을 출력하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Print Red, Green and Blue, one per line, in that order. · Red, Green, Blue을 순서대로 줄마다 출력하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
Print the result of 5 + 3 (it is 8). · 5 + 3의 결과를 출력합니다(그 결과는 8입니다).
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.