I'm experimenting with simple assembly scripts on near and cannot seem to find a way to print the length of an array. Here's the smallest repro:
let a = new Array<string>();
logging.log(a.length.toString());
Doesn't compile with
ERROR TS2339: Property 'toString' does not exist on type 'i32'.
logging.log(a.length.toString());
~~~~~~~~
in assembly/main.ts(171,23)
While toString()
clearly exists on i32
, e.g. the following snippet compiles and works:
let a: i32 = 5;
logging.log(a.toString());