JS Built-ins
Datenowbeginner

Date.now() β€” integer milliseconds

πŸ“– Usage Example
const ts = Date.now()  // e.g. 1705276800000
typeof ts  // β†’ 'number'

Use Date.now() to get the current time as milliseconds since the Unix epoch without creating a Date object.

Date.now()

The return value of Date.now() is always an integer (whole milliseconds).

Challenge: Verify that Number.isInteger(Date.now()) returns true.

πŸ’‘ Hints (1)
  • β€’ Timestamps are counted in whole milliseconds β€” no fractional part