Submit Search
Recap JavaScript and TypeScript.pdf Recap JavaScript and TypeScript.pdf
0 likes
109 views
N
NuttavutThongjor1
Recap JavaScript and TypeScript.pdf Recap JavaScript and TypeScript.pdf
Education
Read more
1 of 77
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
More Related Content
More from NuttavutThongjor1
(20)
PDF
GraphQL.pdfGraphQL.pdfGraphQL.pdfGraphQL.pdfGraphQL.pdfGraphQL.pdf
NuttavutThongjor1
PDF
Nest.js RESTful API development.pdf Nest.js RESTful API development.pdf
NuttavutThongjor1
PDF
Nest.js RESTful API development.pdfNest.js RESTful API development.pdf
NuttavutThongjor1
PDF
Next.js web development.pdfNext.js web development.pdfNext.js web development...
NuttavutThongjor1
PDF
Next.js web development.pdfNext.js web development.pdfNext.js web development...
NuttavutThongjor1
PDF
Fullstack Nest.js and Next.js.pdfFullstack Nest.js and Next.js.pdfFullstack N...
NuttavutThongjor1
PDF
Recap JavaScript and TypeScript.pdf Recap JavaScript and TypeScript.pdf
NuttavutThongjor1
PDF
Intro to Modern DevOps.pdfIntro to Modern DevOps.pdfIntro to Modern DevOps.pdf
NuttavutThongjor1
PDF
10 วัฒนธรรมองค์กรของ DevOps.pdf10 วัฒนธรรมองค์กรของ DevOps.pdf
NuttavutThongjor1
PDF
9 logging and monitoring.pdf 9 logging and monitoring.pdf
NuttavutThongjor1
PDF
8 iac.pdf 8 iac.pdf8 iac.pdf8 iac.pdf8 iac.pdf8 iac.pdf8 iac.pdf
NuttavutThongjor1
PDF
7 cicd.pdf 7 cicd.pdf 7 cicd.pdf 7 cicd.pdf
NuttavutThongjor1
PDF
6 GitOps คืออะไร.pdf 6 GitOps คืออะไร.pdf 6 GitOps คืออะไร.pdf
NuttavutThongjor1
PDF
5 Kubernetes.pdf 5 Kubernetes.pdf 5 Kubernetes.pdf
NuttavutThongjor1
PDF
4 Docker.pdf 4 Docker.pdf 4 Docker.pdf 4 Docker.pdf
NuttavutThongjor1
PDF
3 Microservices.pdf 3 Microservices 3 Microservices.pdf.pdf
NuttavutThongjor1
PDF
2 เทคโนโลยี cloud computing.pdf 2 เทคโนโลยี cloud computing.pdf
NuttavutThongjor1
PDF
1 devops คืออะไร.pdf 1 devops คืออะไร.pdf
NuttavutThongjor1
PDF
angular fundamentals.pdf angular fundamentals.pdf
NuttavutThongjor1
PDF
mean stack mean stack mean stack mean stack
NuttavutThongjor1
GraphQL.pdfGraphQL.pdfGraphQL.pdfGraphQL.pdfGraphQL.pdfGraphQL.pdf
NuttavutThongjor1
Nest.js RESTful API development.pdf Nest.js RESTful API development.pdf
NuttavutThongjor1
Nest.js RESTful API development.pdfNest.js RESTful API development.pdf
NuttavutThongjor1
Next.js web development.pdfNext.js web development.pdfNext.js web development...
NuttavutThongjor1
Next.js web development.pdfNext.js web development.pdfNext.js web development...
NuttavutThongjor1
Fullstack Nest.js and Next.js.pdfFullstack Nest.js and Next.js.pdfFullstack N...
NuttavutThongjor1
Recap JavaScript and TypeScript.pdf Recap JavaScript and TypeScript.pdf
NuttavutThongjor1
Intro to Modern DevOps.pdfIntro to Modern DevOps.pdfIntro to Modern DevOps.pdf
NuttavutThongjor1
10 วัฒนธรรมองค์กรของ DevOps.pdf10 วัฒนธรรมองค์กรของ DevOps.pdf
NuttavutThongjor1
9 logging and monitoring.pdf 9 logging and monitoring.pdf
NuttavutThongjor1
8 iac.pdf 8 iac.pdf8 iac.pdf8 iac.pdf8 iac.pdf8 iac.pdf8 iac.pdf
NuttavutThongjor1
7 cicd.pdf 7 cicd.pdf 7 cicd.pdf 7 cicd.pdf
NuttavutThongjor1
6 GitOps คืออะไร.pdf 6 GitOps คืออะไร.pdf 6 GitOps คืออะไร.pdf
NuttavutThongjor1
5 Kubernetes.pdf 5 Kubernetes.pdf 5 Kubernetes.pdf
NuttavutThongjor1
4 Docker.pdf 4 Docker.pdf 4 Docker.pdf 4 Docker.pdf
NuttavutThongjor1
3 Microservices.pdf 3 Microservices 3 Microservices.pdf.pdf
NuttavutThongjor1
2 เทคโนโลยี cloud computing.pdf 2 เทคโนโลยี cloud computing.pdf
NuttavutThongjor1
1 devops คืออะไร.pdf 1 devops คืออะไร.pdf
NuttavutThongjor1
angular fundamentals.pdf angular fundamentals.pdf
NuttavutThongjor1
mean stack mean stack mean stack mean stack
NuttavutThongjor1
Recap JavaScript and TypeScript.pdf Recap JavaScript and TypeScript.pdf
1.
RECAP JS AND TS Babel
Coder https://www.babelcoder.com
2.
แนะนำตัว Babel Coder Babel Coder https://www.babelcoder.com
3.
Babel Coder BABEL CODER Nuttavut
T https://www.babelcoder.com Babel Coder https://www.babelcoder.com
4.
RECAP JAVASCRIPT Babel Coder https://www.babelcoder.com
5.
Babel Coder Babel Coder https://www.babelcoder.com Runtime JAVASCRIPT Runtime
Runtime Interpreter Interpreter Interpreter JavaScript JavaScript JavaScript
6.
Babel Coder Babel Coder https://www.babelcoder.com ES ECMASCRIPT JavaScript ES DOM ECMAScript
หรือ ES เป็นภาษาต้นแบบที่กำหนดรูปแบบไวยากรณ์ของภาษาที่มีภาษาปลายทาง เช่น JavaScript สืบทอดไวยากรณ์ไปใช้งาน อย่างไรก็ตาม JavaScript ยังมี API อื่น ๆ นอกเหนือจาก API ทาง ภาษาที่กำหนดไว้ใน ES เช่น DOM API ES2015 (ES6) ES2016 ES2017 ES2018 ES2019 ES2020 ES2021 ES2022 ES2023 ES2024
7.
Babel Coder Babel Coder https://www.babelcoder.com PACKAGE
MANAGER
8.
Babel Coder Babel Coder https://www.babelcoder.com src bcrypt PACKAGE
MANAGER api package.json app.controller.ts app.module.ts app.service.ts main.ts node_modules pnpm store bcrypt link
9.
Babel Coder Babel Coder https://www.babelcoder.com person name LET
AND CONST การใช้ let ในการประกาศตัวแปร สามารถเปลี่ยนค่าได้ การใช้ const ในการประกาศตัวแปร ไม่ สามารถเปลี่ยนค่าได้ อย่างไรก็ตามการใช้ const กับออบเจ็กต์ ยังคง สามารถแก้ไขค่าภายในได้ age 24 Somchai 25
10.
Babel Coder Babel Coder https://www.babelcoder.com TEMPLATE
LITERAL สัญลักษณ์ ` ใช้กับไวยากรณ์ของ Template Literal Template Literal สามารถทำ Interpolation คือการ แทนที่ค่าจากตัวแปรหรือค่าข้อมูลได้ และสามารถสร้าง ข้อมูล string แบบหลายบรรทัดได้โดยไม่ต้องใช้ n
11.
Babel Coder Babel Coder https://www.babelcoder.com PROPERTY
SHORTHAND กรณีที่ชื่อของ property เหมือนกับชื่อของ ตัวแปร เราสามารถลดรูปด้วยการระบุแค่ชื่อ property เท่านั้นได้
12.
Babel Coder Babel Coder https://www.babelcoder.com const
housingNo = address.housingNo const village = address.village DESTRUCTURING const name = person.name const age = person.age const gender = person.sex const address = person.address
13.
Babel Coder Babel Coder https://www.babelcoder.com DESTRUCTURING
14.
Babel Coder Babel Coder https://www.babelcoder.com {
a: 1, b: 2, c: 3, d: 6 } SPREAD [’A’, ‘B’, ‘C’, ‘D’, ‘E’]
15.
Babel Coder Babel Coder https://www.babelcoder.com REST const
{ gender, height, ...rest } = person { name: ‘Somchai’, age: 24, weight: 60 } const [ first, , third, ...rest ] = currencies [’THB’]
16.
Babel Coder Babel Coder https://www.babelcoder.com OPTIONAL
CHAINING socials มีค่าเป็น undefined จึงไม่สามารถเรียก facebook ต่อจาก undefined ได้ กรณีเดียวกัน เมื่อ login เป็น undefined จึงไม่ สามารถเรียกแบบฟังก์ชันได้ Optional chaining ที่ใช้สัญลักษณ์เป็น ?. จะช่วย พิจารณาว่าค่าก่อนหน้า ?. นั้นเป็น null หรือ undefined หรือไม่ หากไม่ใช่จึงจะทำการเรียกใช้ค่า หลัง ?. ต่อไป
17.
Babel Coder Babel Coder https://www.babelcoder.com NULLISH
COALESCING 500 0
18.
Babel Coder Babel Coder https://www.babelcoder.com hasError
&& <div>Error!!</div> AND OPERATOR const hasError = true const hasError = false hasError && <div>Error!!</div> true <div>Error!!</div> false
19.
Babel Coder Babel Coder https://www.babelcoder.com OBJECT.KEYS [’name’,
‘age’, ‘socials’]
20.
Babel Coder Babel Coder https://www.babelcoder.com OBJECT.VALUES [’Somchai’,
24, { facebook: ‘somchai’ }]
21.
Babel Coder Babel Coder https://www.babelcoder.com OBJECT.ENTRIES
22.
Babel Coder Babel Coder https://www.babelcoder.com FOR...OF EUR INR USD THB
23.
Babel Coder Babel Coder https://www.babelcoder.com FOR...IN name age socials
24.
Babel Coder Babel Coder https://www.babelcoder.com ARROW
FUNCTION function increase(n) { return n + 1 } const increase = (n) => { return n + 1 } const increase = (n) => n + 1 const increase = n => n + 1
25.
Babel Coder Babel Coder https://www.babelcoder.com ARROW
FUNCTION function add(n, m) { return n + m } const add = (n, m) => { return n + m } const add = (n, m) => n + m
26.
Babel Coder Babel Coder https://www.babelcoder.com 1 const
arr = [ , , ] 2 3 [ , , ] 2 4 6 MAP arr.map(n => n * 2)
27.
Babel Coder Babel Coder https://www.babelcoder.com 1 const
arr = [ , , ] 2 3 [ , ] 2 3 FILTER arr.filter(n => n >= 2)
28.
Babel Coder Babel Coder https://www.babelcoder.com 1 const
arr = [ , , ] 2 3 2 FIND arr.find(n => n >= 2)
29.
Babel Coder Babel Coder https://www.babelcoder.com 1 const
arr = [ , , ] 2 3 1 FIND INDEX arr.findIndex(n => n * 2) index: 0 index: 1 index: 2
30.
Babel Coder Babel Coder https://www.babelcoder.com circle.js ES
MODULE const DEFAULT_COLOR = ‘white‘ class Circle { } triangle.js const DEFAULT_COLOR = ‘white‘ class Triangle { } // import DEFAULT_COLOR main.js
31.
Babel Coder Babel Coder https://www.babelcoder.com circle.js triangle.js main.js main.js ES
MODULE export const DEFAULT_COLOR = ‘white‘ class Circle { } export const DEFAULT_COLOR = ‘white‘ class Triangle { } import { DEFAULT_COLOR } from 'circle' import { DEFAULT_COLOR } from 'circle' import { DEFAULT_COLOR } from 'triangle' Named export
32.
Babel Coder Babel Coder https://www.babelcoder.com circle.js triangle.js
main.js ES MODULE export const DEFAULT_COLOR = ‘white‘ class Circle { } export const DEFAULT_COLOR = ‘white‘ class Triangle { } import * as circle from 'circle' import * as triangle from 'triangle' circle.DEFAULT_COLOR triangle.DEFAULT_COLOR Named export
33.
Babel Coder Babel Coder https://www.babelcoder.com ES
MODULE circle.js triangle.js export const DEFAULT_COLOR = ‘white‘ export default class Circle { } export const DEFAULT_COLOR = ‘white‘ export default class Triangle { } main.js import Circle from 'circle' import Triangle from 'triangle' Default export
34.
Babel Coder Babel Coder https://www.babelcoder.com ES
MODULE circle.js export const DEFAULT_COLOR = ‘white‘ export default class Circle { } main.js import Circle, { DEFAULT_COLO R } from 'circle' default named
35.
Babel Coder Babel Coder https://www.babelcoder.com ES
MODULE circle.js export const DEFAULT_COLOR = ‘white‘ export default class Circle { } main.js import Circle, * as circle from 'circle' default named
36.
Babel Coder Babel Coder https://www.babelcoder.com ASYNCHRONOUS console.log(1) setTimeout(()
=> { console.log(2) }, 1000) console.log(3) 1 2 3 Sync Sync Async Callback function
37.
Babel Coder Babel Coder https://www.babelcoder.com ASYNCHRONOUS import
{ setTimeout } from ‘timers/promises’ console.log(1) setTimeout(10 00).then(() => { console.log(2) }) console.log(3) Promise-based API Callback function
38.
Babel Coder Babel Coder https://www.babelcoder.com ASYNC
/ AWAIT import { setTimeout } from ‘timers/promises’ console.log(1) async function myTimer() { await setTimeout(10 00) console.log(2) } myTimer() console.log(3) const myTimer = async () => { await setTimeout(10 00) console.log(2) }
39.
Babel Coder Babel Coder https://www.babelcoder.com 200 FETCH
API /api/products/1 200 OK Content-Type: application/json res.status res.ok true
40.
Babel Coder Babel Coder https://www.babelcoder.com FETCH
API /api/products/ Content-Type: application/json POST
41.
Babel Coder Babel Coder https://www.babelcoder.com FETCH
API Content-Type: application/json PATCH /api/products/1
42.
Babel Coder Babel Coder https://www.babelcoder.com name price image PATCH FETCH
API Lorem 200 File Form Data Content-Type: multipart/form-data /api/products/1
43.
Babel Coder Babel Coder https://www.babelcoder.com DELETE FETCH
API /api/products/1
44.
RECAP TYPESCRIPT Babel Coder https://www.babelcoder.com
45.
Babel Coder Babel Coder https://www.babelcoder.com JavaScript ES DOM TYPESCRIPT TypeScript Argument
of type 'string' is not assignable to parameter of type 'number' Argument of type 'undefined' is not assignable to parameter of type 'number'
46.
Babel Coder Babel Coder https://www.babelcoder.com package.json BASIC
INSTALLATION
47.
Babel Coder Babel Coder https://www.babelcoder.com BASIC
TYPES let num = 2 let num: number = 2 boolean number string unknown any null undefined void never object true, false 1, 2, 0.2 ‘A’, ‘’ ใช้กับข้อมูลที่ยังไม่ทราบชนิดข้อมูลในขณะนั้น สามารถกำหนดข้อมูลใดให้ก็ได้ null undefined ใช้ในกรณีของฟังก์ชันที่ไม่คืนค่า ใช้เพื่อบ่งชี้ว่าเป็นไปไม่ได้ที่จะเกิดค่านี้ ออปเจ็กต์ใด ๆ
48.
Babel Coder Babel Coder https://www.babelcoder.com number BASIC
TYPES let num = 2 let str = ‘hello’ str = ‘world’ const str2 = ‘hello’ str2 = ‘world’ const arr = [1, 2, 3] const arr: number[] = [1, 2, 3] string ‘hello’ number[] Literal Type
49.
Babel Coder Babel Coder https://www.babelcoder.com INTERFACE infer
50.
Babel Coder Babel Coder https://www.babelcoder.com INTERFACE
51.
Babel Coder Babel Coder https://www.babelcoder.com TYPE
ALIAS
52.
Babel Coder Babel Coder https://www.babelcoder.com INTERSECTION intersect
extends
53.
Babel Coder Babel Coder https://www.babelcoder.com UNION role
จะสามารถกำหนดค่าได้เพียง ADMIN MANAGER หรือ MEMBER อย่างใดอย่างหนึ่งเท่านั้น
54.
Babel Coder Babel Coder https://www.babelcoder.com Merging
interface INTERFACES VS TYPE ALIAS Merging interface เป็นคุณสมบัติของ interface ที่สามารถรวมการประกาศ interface ที่เกิดขึ้นซ้ำหลายครั้งให้ประกอบด้วยทุก properties จาก interface ต่าง ๆ ที่มีชื่อเดียวกัน คุณสมบัตินี้ไม่ปรากฎใน Type alias
55.
Babel Coder Babel Coder https://www.babelcoder.com INTERFACES
VS TYPE ALIAS Type alias มีความยืดหยุ่นในการประกาศโครงสร้างของชนิดข้อมูลที่ซับซ้อนได้มากกว่าการใช้งาน interface
56.
Babel Coder Babel Coder https://www.babelcoder.com ENUM 0 1 2
57.
Babel Coder Babel Coder https://www.babelcoder.com OPTIONAL
PROPERTIES const somchai: Person = { name: ‘Somchai‘, gender: ‘male‘, socials: { facebook: ‘somchai‘ } } socials ไม่จำเป็นต้องมี tiktok ก็ได้เพราะเป็น optional property
58.
Babel Coder Babel Coder https://www.babelcoder.com FUNCTION
TYPES return type สถานการณ์ส่วนใหญ่ TypeScript สามารถ infer ชนิดข้อมูลที่ return จากฟังก์ชันได้จึงไม่จำเป็นต้องระบุ return type อย่างไร ก็ตามหากการ infer นั้นไม่ถูกต้อง เรายังจำเป็นต้องระบุชนิด ข้อมูลที่คืนกลับจากฟังก์ชันอยู่
59.
Babel Coder Babel Coder https://www.babelcoder.com 9 GENERIC
FUNCTIONS maxNum([2, 5, 9, 1]) maxChar([’a’, ‘e’, ‘z’, ‘i’]) z
60.
Babel Coder Babel Coder https://www.babelcoder.com GENERIC
FUNCTIONS
61.
Babel Coder Babel Coder https://www.babelcoder.com GENERIC
FUNCTIONS item สามารถเป็นได้แค่ number หรือ string เท่านั้น sortItem<number>(3142); sortItem(3142);
62.
Babel Coder Babel Coder https://www.babelcoder.com any AS const
product = fetchApi('/products') const product = fetchApi('/products') as Product Product
63.
Babel Coder Babel Coder https://www.babelcoder.com FETCH
API any
64.
Babel Coder Babel Coder https://www.babelcoder.com RECORD
65.
Babel Coder Babel Coder https://www.babelcoder.com PICK
66.
Babel Coder Babel Coder https://www.babelcoder.com OMIT
67.
Babel Coder Babel Coder https://www.babelcoder.com PARTIAL Partial<Person>
68.
Babel Coder Babel Coder https://www.babelcoder.com RETURN
TYPE ดึงชนิดข้อมูลจาก getTheme ที่เป็นโค้ดฝั่ ง JavaScript มาสู่ TypeScript
69.
Babel Coder Babel Coder https://www.babelcoder.com PARAMETERS [items:
unknown[], index: number]
70.
Babel Coder Babel Coder https://www.babelcoder.com KEY
OF ‘name’ | ‘socials’
71.
Babel Coder Babel Coder https://www.babelcoder.com name
Loki no 1234 amount 500 name Thor no 5678 amount 1,000 deposit CLASSES withdraw
72.
Babel Coder Babel Coder https://www.babelcoder.com name
Loki no 1234 amount 500 name Thor no 5678 amount 1,000 deposit withdraw Data DATA AND BEHAVIOR Behavior
73.
Babel Coder Babel Coder https://www.babelcoder.com DATA
AND BEHAVIOR const acc1 = new SavingAccount(); acc1.name = "Loki"; acc1.no = 1234; acc1.balance = 500; acc1.deposit(100) acc1.balance // 600 acc1.withdraw(50) acc1.balance // 550
74.
Babel Coder Babel Coder https://www.babelcoder.com const
acc1 = new SavingAccount("Loki", 1234, 500); CONSTRUCTOR
75.
Babel Coder Babel Coder https://www.babelcoder.com const
acc1 = new SavingAccount("Loki", 1234, 500); // Property 'balance' is private and only accessible // within class 'SavingAccount' acc1.balance; MEMBER VISIBILITY
76.
Babel Coder Babel Coder https://www.babelcoder.com const
acc1 = new SavingAccount("Loki", 1234, 500); CONSTRUCTOR PROPERTY INITIALIZATION
77.
Babel Coder Babel Coder https://www.babelcoder.com DECORATORS