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

Ajax, call jQuery POST to node.js expressjs

Ajax, call jQuery POST to node.js expressjs

Converting Object to an Array

Converting Object to an Array

Spread Operator for Objects

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

Extend Object javascript

Extend Object javascript

using Typescript callback style error handling