JS Built-ins
Datenowbeginner

Date.now() β€” result is positive

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

Since the Unix epoch was January 1 1970, any call made after 1970 returns a positive integer.

Challenge: Verify that Date.now() > 0.

πŸ’‘ Hints (1)
  • β€’ Any time after 1970-01-01T00:00:00Z gives a positive timestamp