์ต์ ๊ธ
-
Typescript - Interfaces (Typescript์์ Object์ ๋ชจ์์ ์๋ ค์ฃผ๋ ๋ฐฉ๋ฒ / ์์๋ฐ๊ธฐ_extends)
โ
Typescript์์ Object์ ๋ชจ์์ ์๋ ค์ฃผ๋ ๋ฐฉ๋ฒ : type ํค์๋๋ฅผ ์ฌ์ฉํ์ฌ ์ค๋ธ์ ํธ์ ๋ชจ์์ ์๋ ค์ฃผ๋ ๋ฐฉ๋ฒ : interface ํค์๋๋ฅผ ์ฌ์ฉํ์ฌ ์ค๋ธ์ ํธ์ ๋ชจ์์ ์๋ ค์ฃผ๋ ๋ฐฉ๋ฒ ๊ณตํต์ ์ฐจ์ด์ Type ์ค๋ธ์ ํธ์ ๋ชจ์์ ๊ฒฐ์ ํ๋ ์ญํ ์ด๋ค. type ํค์๋๋ interface ํค์๋์ ๋นํด ์ข ๋ ํ์ฉํ ์ ์๋๊ฒ ๋ง๋ค. Interface interface๋ ์ค๋ธ์ ํธ์ ๋ชจ์์ ํน์ ํ๋ค๋ ์ค์ง ํ๊ฐ์ง ์ฉ๋๋ง ๊ฐ์ง๊ณ ์๋ค. : Type type Team = 'red'| 'blue' |'yellow' type Health = 1 | 5 | 10 type Player = { nickname: string, team: Team, hea..
2022.12.23
-
Typescript - Function(Generic)
๋ฐฐ์ด์ ๋ฐ๊ณ , ๊ทธ ๋ฐฐ์ด์ ์์๋ฅผ printํด์ฃผ๋ ํจ์ ๋ง๋ค๊ธฐ call signatures๋ฅผ ๋ง๋ค๊ณ ์ฌ์ฉ๋ concrete type์ผ๋ก ์์ฑํ๊ธฐ! type SuperPrint ={ (arr: number[]): void, (arr: boolean[]): void, (arr: string[]): void, (arr: (number|boolean)[]): void, } const superPrint: SuperPrint = (arr) => { arr.forEach(i => console.log(i)) } superPrint([1, 2, 3, 4]) superPrint([true, false, true]) superPrint(['a', 'b', 'c']) superPrint([1, 2, true, false])..
2022.12.22
-
Typescript - Function(call signatures, Overloading)
Call signatures // call signatures ์ด๋? // ex.(a:number, b:number) => number // ์ธ์์ ํ์
์ด๋ ํจ์์ ๋ฐํ ํ์
์ ์๋ ค์ค. // call signatures๋ฅผ ์ ์ธํ๋ ๋ฐฉ๋ฒ 1) type Add = (a:number, b: number) => number; const add : Add = (a, b) => a + b // call signatures๋ฅผ ์ ์ธํ๋ ๋ฐฉ๋ฒ 2) type Add = { (a:number, b: number) : number } const add : Add = (a, b) => a + b // ์๋ชป ์ฌ์ฉ๋ ์ const add : Add = (a, b) => {a + b} // Error: Type 'void' is n..
2022.12.22
-
Typescript - readonly, Tuple, any, unknown, void, never
readonly // readonly๋ ์์๋ค์ ์ฝ๊ธฐ์ ์ฉ์ผ๋ก ๋ง๋ฌ. const numbers : readonly number[] =[1,2,3,4,5] numbers.push(1) // ์๋ํ์ง ์๋๋ค. const array : number[] = [1,2,3,4,5] array.push(1) // ์๋์ด ๋๋ค. Tuple // ์ ํด์ง ๊ฐ์์ ์์์ ๋ฐ๋ผ ๋ฐฐ์ด ์ ์ธ const user: [string, number, boolean] = ["aaa", 1, true] any // ๋ฌด์์ด๋ ์
๋ ฅํ ์ ์๊ฒ๋๋ค. // ํ์
์ฒดํฌ๋ฅผ '๋นํ์ฑํ' ์์ผ๋ฒ๋ฆฐ๋ค. const a : any[] = [1,2,3,4] const b : any = true a + b // ์ค๋ฅ๊ฐ ๋์ง ์์. // any์ ์ฌ์ฉ์ ์ข์ง์์ผ๋ฉฐ, ..
2022.12.22
-
Justgram ํ๋ก์ ํธ
โบ Justgram ํ๋ก์ ํธ โข ๋ ํฌ์งํ ๋ฆฌ ์ฃผ์ Justgram-React-repo < ๋ฐ๋ก๊ฐ๊ธฐ โบ Project ์๊ฐ ์์
๋คํธ์ํฌ ์๋น์ค(SNS) instagram ํด๋ก ํ๋ ํ๋ก์ ํธ ๊ฐ๋ฐ ๊ธฐ๊ฐ | 2022-09-01 ~ 2022-09-08 instagram์ login & home ์ปดํฌ๋ํธ ๊ตฌํํ๊ธฐ ์์
๊ธฐ๊ฐ ๊ตฌํํ ๊ธฐ๊ฐ 2022-09-01 ~ 2022-09-08 Technlogies Front-end HTML | CSS | JAVASCRIPT | REACT | STYLED-COMPONENTS 1. Login Page 1) ๋ก๊ทธ์ธ ํ์ด์ง ๋ ์ด์์ ์ค์ instagram ๋ก๊ทธ์ธ ํ์ด์ง ์ฐธ๊ณ ํ์ฌ ๋์์ธ 2) ID, PW validation ์ ๊ท์์ ์ฌ์ฉ์ ์ฌ์ฉํ์ฌ ์๋์ ์กฐ๊ฑด์ ๋ง์ผ๋ฉด ๋ฒํผ ํ์ฑํ ๋๋๋ก..
2022.10.03