Using bindings
How to access JavaScript from AssemblyScript
Overview
Here is where this AssembyScript gets really exciting. Bindings allow us to call a JavaScript function from AssemblyScript code. For example, if we wanted to make a console.log function, we would use auto-generated bindings to let AS access the function. Let's see an example.
Using bindings
Here we go!
index.js
Insert this code into our main AS file.
Almost there! Make sure to recompile!
And lastly, run!
Awesome! Now, you can call JavaScript from AssemblyScript!
Last updated