Lấy tháng hiện tại trong javascript
Lấy tháng hiện tại trong javascript
const getMonth = (fillFlag=true) => {
const mon = new Date().getMonth() + 1
const monRe = mon
if (fillFlag) mon < 10 ? `0${mon}` : mon
return monRe
}
console.log(getMonth());//5Có thể bạn đã miss một số snippets code
