The shortest possible.
To get format like "2018-08-03":
let today = new Date().toISOString().slice(0, 10)
console.log(today)
To get format like "8/3/2018":
let today = new Date().toLocaleDateString()
console.log(today)
Also, you can pass locale as argument, for example toLocaleDateString("sr")
, etc.