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

Convert Array-like to True Array

Convert Array-like to True Array

kiểm tra email trong javascript

kiểm tra email trong javascript

Converting Object to an Array

Converting Object to an Array

Đếm có bao nhiêu items giống nhau trong một array

reduce javascript. Đếm có bao nhiêu items giống nhau trong một array

Ajax, call jQuery POST to node.js expressjs

Ajax, call jQuery POST to node.js expressjs