JavaScript Programs
A computer program is a list of "instructions" to be "executed" by a computer.
In a programming language, these programming instructions are called statements.
A JavaScript program is a list of programming statements.
In HTML, JavaScript programs are executed by the web browser.
컴퓨터 프로그램이란, 컴퓨터의 의해서 실행되어지는 명령어의 리스트이다.
프로그래밍 언어 안에서 이러한 명령어들은 statements 라고 불리어진다.
자바스크립트 프로그램은 프로그래밍 문장들의 리스트이다.
JavaScript Statements
JavaScript statements are composed of:
Values, Operators, Expressions, Keywords, and Comments.
This statement tells the browser to write "Hello Dolly." inside an HTML element with id="demo":
자바스크립트 문장은 변수와 오퍼레이터 익스프레션 키워드 그리고 주석으로 이루어져 있다.
이런 문장은 브러우저에게 "hello Dolly"를 작성해 라고 말한다. id가 demo인 html 요소안에
Most JavaScript programs contain many JavaScript statements.
The statements are executed, one by one, in the same order as they are written.
JavaScript programs (and JavaScript statements) are often called JavaScript code.
대부분의 자바스크립트 프로그램은 많은 자바스크립트 문장을 포함한다.
문장은 쓰여진것과 같은 순서로 하나씩 하나씩 실행되어진다.
자바스크립트 프로그램은 자주 자바스크립트 코드라고 불리어진다.
Semicolons ;
Semicolons separate JavaScript statements.
Add a semicolon at the end of each executable statement:
세미클론은 자바스크립트 문장을 구별한다.
각각의 실행가능한 문장끝에 세미콜론을 추가하라
When separated by semicolons, multiple statements on one line are allowed:
세미클론으로 구분되어질때, 여러문장은 한줄안에 허용되어진다(한줄에 여러문장이 허용된다)
On the web, you might see examples without semicolons.
Ending statements with semicolon is not required, but highly recommended.
웹에서 너는 세미클론이 없는 예제들을 볼수 있을지도 모른다
세미클론으로 문장을 끝내는 것은 특별하게 요구되지는 않지만, 높게 추천되어진다.
JavaScript White Space
JavaScript ignores multiple spaces. You can add white space to your script to make it more readable.
The following lines are equivalent:
자바스크립트의 공백
자바스크립트는 여러공백을 무시한다. 너는 코드를 더 읽기 좋게 만들기 위해서 공백을 추가할 수도 있다.
다음의 따라오는 문장은 동등하다.
A good practice is to put spaces around operators ( = + - * / ):
( = + - * / ) 오퍼레이터 주변에 공백을 추가하는 것은 좋은 연습이다.
JavaScript Line Length and Line Breaks
For best readability, programmers often like to avoid code lines longer than 80 characters.
If a JavaScript statement does not fit on one line, the best place to break it is after an operator:
자바스크립트 라인의 길이와 라인 break
가장 좋은 가독성을 위해서 개발자는 자주 80자보다 긴 코드라인을 피하길 좋아한다.
만일 자바스크립트 문장이 한줄에 딱 맞지 않는다면, 문장을 끝기 위한 가장 좋은 위치는 오퍼레이터 다음이다.
JavaScript Code Blocks
JavaScript statements can be grouped together in code blocks, inside curly brackets {...}.
The purpose of code blocks is to define statements to be executed together.
One place you will find statements grouped together in blocks, is in JavaScript functions:
자바스크립트 코드 블록
자바스크립트 문장은 코드 블록 안에 함께 그룹핑 될수 있다.
코드 블록의 목정은 함께 실행되기위한 문장을 정의하는 것이다.
너가 블록안에함께 그룹핑 될 문장을 찾은 위치는 함수이다.
In this tutorial we use 2 spaces of indentation for code blocks.
You will learn more about functions later in this tutorial.
이번 튜토리얼에서 우리는 코드블록을 위해서 2개의 들여쓰기를 사용한다
너는 이튜토리얼 후에 함수에 대해서 많이 배울 수 있다.
'영어공부' 카테고리의 다른 글
JavaScript Comments (0) | 2020.02.12 |
---|---|
JavaScript Syntax (0) | 2020.01.23 |
JavaScript Output (0) | 2020.01.23 |
JavaScript Where To (0) | 2020.01.23 |
JavaScript Introduction (0) | 2020.01.23 |