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

Object.keys và Object.getOwnPropertyNames

Object.keys và Object.getOwnPropertyNames

Random String

Random String với độ dài tuỳ chọn

flatMap()

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

using javascript callback style error handling

Merge Array

How to combine two sorted arrays into one? We can do this easily with the spread operator.