=> ์น Html, CSS, JS ์คํฌ๋ฆฝํธ์ธ์ด (์ธํฐํ๋ฆฌํฐ ์ธ์ด)
=> ํ์คํ์ค ๋ณด๋ฉด์ ์ค๋ฅ์ฒดํฌ
bodyํ๊ทธ ๋๋๊ธฐ ์ ์
<script>
console.log('console ์ฐฝ์ ์ถ๋ ฅ 1');
</script>
=> ๊ทธ๋ฆฌ๊ณ ์น ๋ธ๋ผ์ฐ์ ์ฐฝ ๋ค์ด๊ฐ์ ๊ฐ๋ฐ์๋๊ตฌ -> ์ฝ์์ฐฝ์ผ๋ก ๋ณด๋ฉด 'console ์ฐฝ์ ์ถ๋ ฅ 1' ์ถ๋ ฅ!
์ธ๋ถ CSS ์ ์ฉํ๋๊ฑฐ๋ ๋๊ฐ์ด ํ์ผ๋ช .js๋ก ํ์ผ๋ง๋ค์ด์ฃผ๊ณ
<script src="./js1.js"></script>
์ด๋ ๊ฒ ์ ์ฉ!
=> code Runner๋ Node.js ์ค์นํ๊ณ ๋์
=> ctrl + alt + n ๋๋ฅด๋ฉด ์ฝ์์ฐฝ์ด ๋ณด์ธ๋ค
๐ค
let v1 = 10;
let v2 = 123.123;
let v3 = '๋ฌธ์';
let v4 = "์ด๊ฒ๋ ๋ฌธ์";
๐ค
const v8 = 10; //์์ํ ๋ณ์ํ์
์ด๋ผ ์ดํ์ ๊ฐ์ ์์ x
v8 = 20; (X)
1) ๋ฌธ์์ด
${๋ค๋ฅธ๋ณ์}
๐ค
let str1 = ๋ฐฑํฑ์ผ๋ก ๊ฐ์ธ๋ฉด ํฐ" ์์' ์ ๊ฒฝ์์ฐ๊ณ ์์ฑ๊ฐ๋ฅ
;
๐ค
let n1 = 2;
let n2 = 10;
let result1 = n1 + ' ' + n2 + ' = ' + (n1n2);
let result2 = ${n1} * ${n2} = ${n1 * n2}
;
=> 2 * 10 = 20 ์ถ๋ ฅ!!
2) ์ซ์ํ : ์ ์ํ, ์ค์ํ
3) ๋
ผ๋ฆฌํ : true, false
4) ๊ธฐํํ
5) ๋ฐฐ์ด : []
๐ค
let arr = [1,2,3,4,5];
let arr2 = ['A', 'B', 'C'];
console.log(arr); => [1, 2, 3, 4, 5]
console.log(arr2); => ['A', 'B', 'C']
6) ๊ฐ์ฒด : {}
=>
๐ค
let student1 = {
id:'mystu',
name:'๋ด์ด๋ฆ',
age:30
};
console.log(student1); => { id: 'mystu', name: '๋ด์ด๋ฆ', age: 30 }
console.log(student1.id); => mystu
console.log(student1.name); => ๋ด์ด๋ฆ
let pizza = {
type:'ํ๋ฆฌ๋ฏธ์',
price:23000,
base: { //๊ฐ์ฒด ์์ ๊ฐ์ฒด!
dough:"๋ฐ๊ฐ๋ฃจ",
cheese:"๊ตญ์ฐ์น์ฆ"
},
topping:['ํ', '์์ฐ', 'ํ์ธ์ ํ'] //๊ฐ์ฒด ์์ ๋ฐฐ์ด!
};
console.log(pizza.price); => 23000
console.log(pizza.base.dough); => ๋ฐ๊ฐ๋ฃจ
console.log(pizza.topping[2]); => ํ์ธ์ ํ