Tránh viết biến có phạm vi global

tipjs,scope,global

Không nên

    var map = document.querySelector("#my-map");
    map.style.height = "600px";
Nên
!function(){
    var map = document.querySelector("#my-map");
    map.style.height = "600px";
}()

Có thể bạn đã miss một số snippets code

Object.keys và Object.getOwnPropertyNames

Object.keys và Object.getOwnPropertyNames

JavaScript: async/await with forEach

JavaScript: async/await with forEach()

Converting Object to an Array

Converting Object to an Array

Copy a string to the clipboard

Copy a string to the clipboard. Only works as a result of user action (i.e. inside a click event listener).

Getting the last element of a split string array

Getting the last element of a split string array