What is the code for getting the current time?

Tâm Tây

New member
What is the code for getting the current time?
A. now = new Date();
B. var now = new Date();
C. var now = Date();
D. var now = new Date(current);
 
Answer: b
Explanation: Date() is a predefined function in javascript which returns the date in string form. The above code determines the current time and stores it in the variable “now”.
 

Tìm kiếm

Back
Top