5.7.1 Java  Script Types loader.mjs Accounts Contracts Network Utilities Utilities ask.mjs Types

The table below shows the JavaScript representation of each of the Reach types:

// Reach  => JavaScript
Null      => null
Bool      => 'boolean'
UInt      => 'BigNumber' or 'number'
Bytes     => 'string'
Digest    => 'BigNumber'
Address   => NetworkAccount
Token     => Address on ETH; UInt on ALGO
Array     => array
Tuple     => array
Object    => object
Data      => ['variant', value]
Struct    => object

For example, the Reach type MInt = Data({None: Null, Some: UInt}) inhabitant MInt.Some(42) is represented as ['Some', 42] in JavaScript.