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

closure javascript

closure javascript

try/catch es10

An update for developer convience allows the use of try/catch without an explicit e Error reference in the catch call.

flatMap()

Use flatMap() creates a new array with sub-array elements flattened by specified depth.

Spread Operator for Objects

Using the spread operator during an Object declaration will assign the properties of the referenced Object to the new Object.

Sự khác biệt giữa substr và substring

Sự khác biệt giữa substr() và substring() chức năng trong JS là gì?