TIL 0406

vllyj2260ยท2020๋…„ 4์›” 6์ผ
0

TIL

๋ชฉ๋ก ๋ณด๊ธฐ
19/54
post-thumbnail

์˜ค๋Š˜ ๋ชฉํ‘œ

html ์˜ˆ์ œ ํ’€์–ด๋ณด๋ฉฐ ๋ณต์Šต ๐Ÿ™†โ€โ™€๏ธ
CSS flex ์ •๋ฆฌ ๐Ÿ™†โ€โ™€๏ธ
js ํฌ๋กฌ ํ”„๋กœ์ ํŠธ ์‹œ์ž‘ - ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด ์ด๋ก ๊นŒ์ง€(์ด๋ก  ์ตœ๋Œ€ 2์ผ) - ์ด๋ก  ์™„๋ฃŒ ๐Ÿ™†โ€โ™€๏ธ
javascript ์˜ˆ์ œ ํ’€์–ด๋ณด๋ฉฐ ๊ณต๋ถ€ - Declare string variables ๊นŒ์ง€ ๐Ÿ™†โ€โ™€๏ธ
Codecademy ๋กœ ์ด๋ก  ๊ณต๋ถ€ ๐Ÿ™…โ€โ™€๏ธ

์˜ค๋Š˜ ๊ณต๋ถ€ํ•œ ๊ฒƒ

freecodecamp ์—์„œ html ์˜ˆ์ œ ํ’€๋ฉฐ ๋ณต์Šต

nomardcoder

javascript ์˜ ์˜ํ–ฅ๋ ฅ์ด ์ปค์กŒ๋‹ค
๋ชจ๋“  ์ปดํ“จํ„ฐ๊ฐ€ ์ด ์–ธ์–ด๋ฅผ ์ดํ•ดํ•œ๋‹ค
์›น ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๊ฒŒ์ž„์ด๋‚˜ ์•ฑ์„ interactive ํ•˜๊ฒŒ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋‹ค
ES5, ES6
์—…๋ฐ์ดํŠธ ๋ฒ„์ „? ์„ ๋‚˜ํƒ€๋‚ด๋Š” ๊ฒƒ
๋ฐ”๋‹๋ผ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ž€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์—†๋Š” ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ์ด๋‹ค
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ์—์„œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋‚˜ ํ”„๋ ˆ์ž„์›Œํฌ๋Š” ํ™”์žฅ ๊ฐ™์€ ์กด์žฌ
๊ทธ๋ž˜์„œ ๋ฐ”๋‹๋ผ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋ฅผ ๋Šฅ์ˆ™ํ•˜๊ฒŒ ๋‹ค๋ฃฐ ์ค„ ์•Œ์•„์•ผ ํ•œ๋‹ค
๋ชจ๋“  ์›น์˜ ๋ฒ ์ด์Šค๊ฐ€ ๋˜๋Š” ์–ธ์–ด

๋ณ€์ˆ˜ ์„ ์–ธ์—๋Š” let ๊ณผ const ๊ฐ€ ์žˆ๋‹ค
๋ณ€์ˆ˜๋ฅผ ์„ ์–ธํ• ๋•Œ๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ const ๋ฅผ ์“ธ ๊ฒƒ
float ๋Š” ์†Œ์ˆ˜์ ์„ ๊ฐ€์ง€๊ณ  ์žˆ๋Š” ์ˆซ์ž

const num = 5.1;

_array
๋ฐ์ดํ„ฐ๋ฅผ ์ €์žฅํ•˜๋Š” ๊ณณ ๋ฆฌ์ŠคํŠธ
๋ณ€์ˆ˜๋ช…์€ ์–ธ์ œ๋‚˜ ์†Œ๋ฌธ์ž๋กœ ์‹œ์ž‘ํ•ด์„œ ์ค‘๊ฐ„์— ๋Œ€๋ฌธ์ž๋กœ ์‹œ์ž‘ํ•˜๋Š” ๋‹จ์–ด๋ฅผ ๋ถ™์ž„

const peopleNumber = 3;

์—ฌ๋Ÿฌ ๋ฐ์ดํ„ฐ๋ฅผ ํ•˜๋‚˜๋กœ ๋ฌถ๋Š” ๊ฒƒ

const something = "hi"
const daysOfWeek = ["์ด ์•ˆ์—๋Š” ๋ฐ์ดํ„ฐ ํƒ€์ž…๋งŒ ์“ธ ์ˆ˜ ์žˆ์Œ", "Monday",12, true, something];
console.log(daysOfWeek[2]); // 12 ์ถœ๋ ฅ - 0๋ถ€ํ„ฐ ์ถœ๋ฐœ

_object
๊ฐ value ์— ๊ฐ’์„ ์ค„ ์ˆ˜ ์žˆ๋‹ค

const userInfo = {name:"Pin", age:25, gender:"Male"};
console.log(userInfo.gender); // Male ์ถœ๋ ฅ
userInfo.gender = "Female";
console.log(userInfo.gender); // Female ์ถœ๋ ฅ

์ˆซ์ž๋ž‘ ๋ฌธ์ž or ture,false ๋ฅผ ๋”ํ•˜๋ฉด ๋ฌธ์ž๊ฐ€ ๋œ๋‹ค

5 + 'Hi' //"5Hi"
'Hi' + true // "Hitrue"

์–ด๋ ค์› ๋˜ ๋ถ€๋ถ„

0๊ฐœ์˜ ๋Œ“๊ธ€