Date() returns a timestamp formatted as a string.
new Date()returns an instance Date.
Constructor instances Datehave values that are converted to numbers, so it new Date().valueOf()returns a number. Strings are just strings, so when you call Date().valueOf(), you get the same string result.
source
share