While making something, I accidentally wrote
const today = Date()
Instead of
const today = new Date()
And was surprised to find that this is valid syntax, and today
's type is a string. Moreover, Date() === new Date().toString()
returns true.
I could not find anything in the MDN docs about this, why does this happens?