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

Spread Operator for Objects

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

Getting the last element of a split string array

Getting the last element of a split string array

Lấy ngày hiện tại trong javascript

Lấy ngày hiện tại trong javascript

So sánh hai array trong javascript

Làm thế nào để đánh giá xem hai mảng có bằng nhau không? Có hai cách đó là sử dụng JSON.stringify() hoặc toString()

Đếm số phần tử trong mảng JavaScript

Đếm số lần xuất hiện của các phần tử trong mảng JavaScript