1.

Which of the following are static methods in JavaScript?(a) Date.parse()(b) Date.UTC()(c) Both Date.parse() and Date.UTC()(d) Date.clear()I had been asked this question in an interview for job.The origin of the question is Comparison of Core JavaScript versus Frameworks in division Caching, Debugging and Animation of JavaScript

Answer»

Correct answer is (c) Both Date.parse() and Date.UTC()

To EXPLAIN I would say: Date objects are created with the NEW Date() constructor. Date.parse() parses a STRING representation of a date and time and returns the internal MILLISECOND representation of that date. Date.UTC() Returns the millisecond representation of the specified UTC date and time.



Discussion

No Comment Found

Related InterviewSolutions