Basic JavaScript

왕초보 입문기

변수에 관하여

In JavaScript all variables and function names are case sensitive. This means that capitalization matters.

변수에는 카멜 표기법을 사용

Write variable names in JavaScript in camelCase. In camelCase, multi-word variable names have the first word in lowercase and the first letter of each subsequent word is capitalized.

변수의 첫 글자소문자로 쓰고 이후 단어의 첫 글자 마다 대문자를 쓴다.

변수 선언 방식

ES6 부터 var는 지양하고 가급적 let과 const를 사용

const someVariable;
const anotherVariableName;
const thisVariableNameIsSoLong;

1순위로 const를 사용하고 재할당이 필요한 경우만 let을 쓴다

reference

주석 넣기

주석은 JavaScript가 의도적으로 무시하는 코드 행을 말함. 이를 통해 자신에게 필요한 메모와 코드를 읽는이를 위한 안내사항을 기록할 수 있음

한줄 주석 //

// 다음은 주석입니다

여러줄 주석 /* */

/* 여러줄의 
주석을 입력할때는
다음과 같이 합니다
*/

Last updated