I'm developing a game in Dart, and I want to migrate the drawing to PIXI.js. Basically one approach that occurred to me is to convert the game state into a JSON object, and pass this JSON object to an external JS method, which would then create the PIXI containers.

How do I make a JSON object and how do I pass it to an external JavaScript function?