Constant:JavaScript constants, also known as literal constants, are information solidified in program code.
Variable:The main function of a variable is to access data and provide a container to access information.
Data TypeInteger: an integer constant is a number in decimal, octal, and hexadecimal notation. String: one or several characters enclosed by "" or. Boolean: Boolean constants are logical "true" and "false ". Null: In JavaScript, "null" indicates nothing.
A warning box is displayed:Alert
The "yes/no" dialog box is displayed:Confirm
Output to page content:Document. write
Get built-in objects:Dateobj = new Date (); theYear = dateobj
.GetYear ();
Common Methods for javascript Date objects
Method |
Description |
GetDate () |
Return date value (1-31) |
GetDay () |
Returns the week value (0-6) |
GetHours () |
Returns the hour value (0-23) |
GetMinutes () |
Returns the minute value (0-59) |
GetSeconds () |
Returns the second value (0-59) |
GetMonth () |
Returns the month value (0-11) |
GetFullYear () |
Returns the year. The value is 4 digits. |
GetTime () |
Returns the number of milliseconds since (1970 01 ). |