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

date,tipjs,function

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

const getDay = (fillFlag=true) => {
  const day = new Date().getDate()
  const dayRe = day
  if (fillFlag) day < 10 ? `0${day}` : day
  return dayRe
}

//Ouput:
console.log(getDay());//27

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

group by property javascript use reduce

group by property javascript use reduce

try/catch es10

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

Rolling loading

Nguyên tắc là theo dõi các sự kiện cuộn trang và phân tích mối quan hệ thuộc tính giữa clientHeight , scrollTop và scrollHeight .

Merge Array

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

Kiểm tra định dạng email bằng Javascript

Kiểm tra định dạng email bằng Javascript