adplus-dvertising
frame-decoration

Question

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);

Posted under JavaScript

Answer: (b).var now = new Date();

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the code for getting the current time?

Similar Questions

Discover Related MCQs

Q. What is the code to start displaying the time when document loads?

Q. One of the main advantage of using src attribute is

Q. What will be done if more than one page requires a file of JavaScript code?

Q. What is the default value of the type attribute?

Q. The word 'document' mainly refers to

Q. Which object is the main entry point to all client-side JavaScript features and APIs?

Q. Which identifier is used to represent a web browser window or frame?

Q. Which property in the Window object is used to refer to a Location object?

Q. Which Window object method is used to display message in a dialog box?

Q. The setTimeout() method is used to

Q. Which of the following is a global object?

Q. When will the window property come into play?

Q. Which is the property that represents the content displayed in the window?

Q. How to pick a document element based on the value of its id attribute?

Q. What is the property to access the first child of a node?

Q. What are the properties supporting CSS styles for a document element?

Q. The style property belongs to while of the following object?

Q. What is the purpose of the event handlers in the JavaScript?

Q. Which handler is triggered when the content of the document in the window is stable and ready for manipulation?

Q. When a program contains extensive use of event handlers, which of the following is necessary?