TIL 29 (2020.08.17)

백은진·2020년 8월 17일
0

TIL (Today I Learned)

목록 보기
29/106

JavaScript

Codecademy에서 [Learn JavaScript] 강의를 시작했다.

강의는 총 14 개의 섹션으로 나뉘어져 있다.

1. Introduction
2. Conditionals
3. Functions
4. Scope
5. Arrays
6. Loops
7. Iterators
8. Objects
9. Classes
10. Browser Compatibility and Transpilation
11. Modules
12. Promises
13. Async-Await
14. Requests

1. Introduction

오늘은 1. Introduction 섹션을 진행했다.

JavaScript는 컴퓨터 언어 중 가장 많이 사용되고 유연성과 성능이 높다.
그러면서도 빠른 속도로 발전하고 성장하는 추세여서 꼭 알아둬야 할 컴퓨터 언어 중 하나이다.

현재 프론트엔드와 백엔드를 모두 작성할 수 있는 컴퓨터 언어는 자바스크립트가 유일하다고 한다.
그래서 다른 컴퓨터 언어로 작성된 코드 중 자바스크립트로 쓰일 수 있는 코드는 모두 재작성되어 대체될 수 있다고 한다.

즉, 현재처럼 여러가지의 컴퓨터 언어로 코드를 작성하는 것 대신에
JavaScript 한 언어로만 프로그래밍을 할 수도 있는 것이다.

그렇기에 JavaScript는 그 중요성이 더욱 대두되고 있다.

Console

console.log('Hello' + ' ' + 'World')

--> Hello World 출력됨

Comments

한줄 주석 
--> // 설명설명

여러줄 주석
--> /* 여러줄 */

Data Types

7 data types in total:
[Numbers, String, Boolean(T or F), Null, Undefined, Symbol, Object]

Arithmetic Operators

Add: +
Subtract: -
Multiply: *
Divide: /
Remainder: %  --> 나누기 후 남은 숫자를 알려줌

String Concatenation

문자끼리 합쳐서 출력할 수 있음
console.log('Hello' + ' ' + 'World')

--> Hello World

Properties

.length Property

console.log('Hello World'.length)

--> 11 (띄어쓰기도 문자 1개로 침)

Methods

Methods는 일종의 명령어이다. (혹은 함수이다.)

console.log('hello'.toUpperCase());
-->'HELLO'

console.log('Hey'.startsWith('H'));
--> true

Mozilla 페이지에서 각종 Objects의 종류와 사용법을 자세히 볼 수 있다.

Built-in Objects

console.log(Math.random()); 
--> Prints a random number between 0 and 1

console.log(Math.floor(Math.random() * 50)); 
--> Prints a random whole number between 0 and 50

오늘 1. Introduction 섹션에서 배운 단어의 개념과 기능을 이 페이지에서 모아볼 수 있다.

profile
💡 Software Engineer - F.E

0개의 댓글