Learning Javascript Flashcards

(46 cards)

1
Q

Primitive types

A

Kiểu dữ liệu nguyên thủy: string, number, boolean, null, undefined, symbol, bigint

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Boolean: Truthy/Falsy

A

Giá trị nào được ép thành true/false khi convert sang boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Hoisting

A

Variable/function declarations are moved to the top
Đưa khai báo biến/hàm lên đầu phạm vi

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Scope

A

Where a variable is accessible

Phạm vi biến có thể được truy cập

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Closure

A

Function remembers variables from its lexical scope
Hàm ghi nhớ biến của phạm vi cha

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Lexical Scope

A

Scope determined by code location
Phạm vi xác định theo vị trí mã nguồn

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

IIFE

A

Function that runs immediately after declaration
Hàm tự chạy ngay sau khi định nghĩa

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

this

A

Context depending on how function is called
Ngữ cảnh – phụ thuộc cách gọi hàm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

call / apply / bind

A

Set this manually when calling a function
Gán this thủ công khi gọi hàm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Prototype

A

Object inheritance chain
Chuỗi kế thừa đối tượng

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Event Loop

A

JS concurrency model for async tasks
Cơ chế xử lý bất đồng bộ

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Promise

A

Handle asynchronous values
Giá trị bất đồng bộ trong tương lai

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

async / await

A

Syntactic sugar for working with Promises
Cú pháp ngắn gọn xử lý Promise

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

try / catch / finally

A

Error handling structure
Cấu trúc xử lý lỗi

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

typeof / instanceof

A

Type checking operators
Toán tử kiểm tra kiểu

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Destructuring

A

Extract values from object/array
Giải nén biến từ object/array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Spread / Rest

A

Copy or group values with …
Toán tử trải rộng hoặc gom nhóm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Template literals

A

String interpolation with backticks
Chuỗi nội suy dùng backtick ``

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Arrow function

A

Shorter function syntax without this binding
Hàm ngắn gọn, không có this riêng

20
Q

Map / Set

A

New data structures for key-value or unique values
Cấu trúc dữ liệu mới cho key-value hoặc giá trị không trùng

21
Q

WeakMap / WeakSet

A

Like Map/Set but with weak references
Giống Map/Set nhưng tránh memory leak

22
Q

Array methods

A

Useful array operations: map, filter, reduce, etc.
Các phương thức xử lý mảng

23
Q

Pure Function

A

Function with no side effects
Hàm thuần – không thay đổi bên ngoài

24
Q

Immutability

A

Avoid mutating original data
Tính bất biến – không thay đổi dữ liệu gốc

25
Currying
Transform function with multiple args into nested functions Chuyển hàm nhiều tham số thành nhiều hàm lồng nhau
26
Composition
Combine functions for cleaner logic Kết hợp nhiều hàm nhỏ thành hàm lớn.
27
When we use currying?
- tái sử dụng logic - khi có hàm nhận nhiều tham số và thường xuyên gọi nó với 1 vài tham số giống nhau - khi áp dụng functional programming, ví như trong các thư viện: ramba, lodash/fp, redux (đặc biệt là trong middleware hoặc selector logic
28
Class / Constructor
OOP syntax for defining objects Cú pháp lập trình hướng đối tượng
29
Inheritance
Extend class functionality Tính kế thừa
30
Encapsulation
Hiding internal logic/data Tính đóng gói
31
Module System
Reusable code via import/export Hệ thống module: import/export
32
Garbage Collection
Auto-releasing unused memory Thu gom bộ nhớ tự động
33
Memory Leak
Unused memory not released due to references Rò rỉ bộ nhớ
34
Debounce / Throttle
Control frequent event executions Giới hạn tần suất gọi hàm
35
Lazy loading
Load resources only when needed Tải chậm – chỉ khi cần
36
Service Workers
Background script for caching/offline Script chạy nền phục vụ offline/cache
37
Web Workers
Run JS in separate threads Chạy JS song song để tránh block UI
38
Event Delegation
Add one listener to handle child events Uỷ quyền sự kiện từ cha tới con
39
Design Patterns
Common reusable coding solutions Các mẫu thiết kế phần mềm thường dùng
40
Fetch API
Native modern HTTP request API Gửi request HTTP hiện đại
41
AbortController
Cancel fetch requests Hủy request đang chạy
42
LocalStorage / SessionStorage
Store key-value in browser Lưu trữ dữ liệu trong trình duyệt
43
History API
Navigate without page reload Điều hướng mà không reload trang
44
IntersectionObserver
Detect element entering viewport Theo dõi phần tử khi vào màn hình
45
MutationObserver
Detect DOM changes Theo dõi sự thay đổi DOM
46
Custom Events
Define and trigger your own events Tạo sự kiện tùy chỉnh