Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/automerge/next_types.ts>Counter#valueOf

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
Go to Latest
method Counter.prototype.valueOf
Re-export
import { Counter } from "https://deno.land/x/automerge@2.2.0/next_types.ts";

A peculiar JavaScript language feature from its early days: if the object x has a valueOf() method that returns a number, you can use numerical operators on the object x directly, such as x + 1 or x < 4. This method is also called when coercing a value to a string by concatenating it with another string, as in x + ''. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf

Returns

number