How to call javascript functions from functions defined within .jslib plugins?

This seems pretty straightforward but thus far I haven’t found any info regarding this issue. Say I have the following code:

mergeInto(LibraryManager.library, {

      Example: function (){
            // Do some things
           var thing = CodeToCall();
      CodeToCall: function (){
            return 10;         


Though it compiles and I can run my game over the web, whenever my C# code makes a call to Example, it executes the function, but then says that CodeToCall is not defined as a function. This is my first foray into implementing Javascript into my game so that I can interact with the page, so there may be something vital that I didn’t realize I needed to do.

Any insight is appreciated!

I figured this out on my own through trial and error. For anyone else finding this, the javascript functions that you call within the functions defined in .jslib should be defined in the javascript files of your webpage. In this case, CodeToCall should either be defined in a .js file linked to the webpage/index file or defined in a