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

JavaScript: async/await with forEach

JavaScript: async/await with forEach()

Getting the last element of a split string array

Getting the last element of a split string array

Ajax, call jQuery POST to node.js expressjs

Ajax, call jQuery POST to node.js expressjs

How to reverse an Array?

Reversing an array in JS is really simple with the standard array method. Like below

Async await in javascript

Async await in javascript