ChronosChronos

Protocol Methods

Methods that enables Chronos to follow JavaScript runtime protocols

Overview

Protocol methods participate in JavaScript/runtime “protocols” or language conventions.

Available Protocol Methods

  • valueOf - Enable Number coercion.
  • toJSON - Enable JSON serialization.
  • inspect - Returns a debug-friendly string representation for console.log and Node.js util.inspect.

Example

playground.ts

Last updated: Fri, Jun 19, 2026 06:06:59PM (UTC)

On this page