JS Built-ins
Datenowbeginner

Date.now() β€” returns a number

πŸ“– 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()

Returns the current time as milliseconds since the Unix epoch (a number).

Challenge: Verify that typeof Date.now() returns 'number'.

πŸ’‘ Hints (1)
  • β€’ Date.now() is the static shorthand for getting the current timestamp in ms