And the difference between js Date new Date () of

Date () with the new Date () returns the same content, but not the same format, Date () Returns a string, new Date () returns the time of the object. Thus,
new new Date () can use the properties and methods of the Date object.

js Date new Date and the difference between pictures
Date difference with new Date () of

 

var a = Date();
var b = new Date();

console.log('a>Date>', a)
console.log('a>Date>typeof>', typeof a)


console.log('b>Date>', b)
console.log('b>Date>typeof>', typeof b)
console.log('b>Date>instanceof>', b instanceof Date)

 

Guess you like

Origin blog.csdn.net/qq_33650655/article/details/91535092