Please enable JavaScript.
Coggle requires JavaScript to display documents.
JS-General - Coggle Diagram
JS-General
Cookies, session storage, local storage
-
-
Cookies
-
-
-
-
-
dùng để đăng nhập, lưu vài giá trị cơ bản và đơn giản.
-
Call, Apply, Bind
Call && Apply
-
Difference
call() truyền vào từng arg one-by-one, trong khi apply() truyền arg vào là 1 mảng
Bind
Bind tạo ra một function mới, với context this là object đã nhận, function mới này có thể gọi lại nhiều lần
với mỗi function mới được tạo ra từ (function gốc).bind sẽ không chấp nhận bất kì context nào cho this nữa, this trong function này sẽ là object được bind lần tiên.
Dom
Bubbling & Capturing
Bubbling
When an event happens on an element, it first runs the handlers on it, then on its parent, then all the way up on other ancestors.
Capturing
-
Giải quyết event bubbling không thể lắng nghe được, ví dụ như event focus của input.
-
General
-
use strict
-
To keep the old code working, most such modifications are off by default.
-
your code is all in classes and modules, you may omit it.
-
Secure
Same-origin policy
ngăn chặn JavaScript code có thể tạo ra những request đến những nguồn khác với nguồn mà nó được trả về.
-
Miscellaneous
Expression vs Statement
Expression
-
It can be as simple as a single value or more complex with operators, variables, and function calls
-
Statements
-
they are used to control the flow of the program, declare variables, or execute tasks