Detect when your site is visible to users
tipjs,web_developer
document.onvisibilitychange = function () {
document.visibilityState === "visible"
? (document.title = "👋 Hello")
: (document.title = "😟 Bye!");
};Có thể bạn đã miss một số snippets code
flatMap()
Use flatMap() creates a new array with sub-array elements flattened by specified depth.
Async await in javascript
Async await in javascript
serialize Form
Sử dụng formdata constructor để convert form, FormData, array.from(). Kết hợp window.encodeURIComponent() để encode từng value trong form.
Lấy ngày hiện tại trong javascript
Lấy ngày hiện tại trong javascript