Assembly Script Example
assembly/index.ts:
@external("app", "random") export declare function random(): i32; @external("app", "result") export declare function result(n: i32): void; function add(a: i32, b: i32): i32 { return a + b + random(); } export function main(): void { result(add(1, 2)); }
build
run main
Build and Run (On Server)
Result