From 0398c489b4d067bfcaa808eb15b57fce880a4ad5 Mon Sep 17 00:00:00 2001 From: eunwoohwang Date: Thu, 9 Apr 2026 13:21:36 +0900 Subject: [PATCH] =?UTF-8?q?feat:=204=EC=A3=BC=EC=B0=A8=20=EB=AF=B8?= =?UTF-8?q?=EC=85=98=20=EC=B4=88=EA=B8=B0=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ IO.cjs | 10 ++++++++++ eventLoop.js | 7 +++++++ test.txt | 1 + type.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 68 insertions(+) create mode 100644 .gitignore create mode 100644 IO.cjs create mode 100644 eventLoop.js create mode 100644 test.txt create mode 100644 type.ts diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6ed48a9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +node_modules diff --git a/IO.cjs b/IO.cjs new file mode 100644 index 0000000..3d3d893 --- /dev/null +++ b/IO.cjs @@ -0,0 +1,10 @@ +const fs = require("fs"); + +console.log("Start"); + +fs.readFile("test.txt", "utf8", (err, data) => { + if (err) throw err; + console.log("File:", data.trim()); +}); + +console.log("End"); \ No newline at end of file diff --git a/eventLoop.js b/eventLoop.js new file mode 100644 index 0000000..42ebce7 --- /dev/null +++ b/eventLoop.js @@ -0,0 +1,7 @@ +console.log("A"); + +setTimeout(() => { + console.log("B"); +}, 0); + +console.log("C"); diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..693cf43 --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +"Hello World!" \ No newline at end of file diff --git a/type.ts b/type.ts new file mode 100644 index 0000000..bc9b7f4 --- /dev/null +++ b/type.ts @@ -0,0 +1,48 @@ +let a: string = "UMC 10th"; + +let b: { + id: number; + name: string; +} = { + id: 1, + name: "홍길동", +}; + +let f: null[] = [null, null, null]; +let g: undefined[] = [undefined, undefined, undefined]; + +let h: string | number; +h = "UMC"; +h = 1; + +// function 형태 +function test1(value: number): number { + return value; +} + +// arrow function 형태 +const test2 = (value: number): number => { + return value; +}; + +function getFirst(arr: T[]): T { + return arr[0]; +} + +const i = getFirst([1, 2, 3]); // i는 number +const j = getFirst(["U", "M", "C"]); // j는 string + +type ChallengerType = { + id: number; + name: string; +}; + +interface Challenger { + id: number; + name: string; +} + +const me: Challenger = { + id: 1, + name: "홍길동", +}; \ No newline at end of file