function currentDate() { const date = new Date(); const year = date.getFullYear(); const month = date.getMonth() + 1; const day = date.getDate(); const format = n => n < 10 ? '0' + n : n; return year + '-' + format(month) + '-' + format(day); }
function currentDate() { const date = new Date(); const year = date.getFullYear(); const month = date.getMonth() + 1; const day = date.getDate(); const format = n => n < 10 ? '0' + n : n; return year + '-' + format(month) + '-' + format(day); }