SyntaxFix
Write A Post
Hire A Developer
Questions
Solution in ES6/TypeScript:
let d = new Date; console.log(d, [`${d.getFullYear()}`, `0${d.getMonth()}`.substr(-2), `0${d.getDate()}`.substr(-2)].join("-"));