Running the program
How to run our first AssembyScript program!
Setting it up
Navigate to the index.js
file in your project folder. Replace it with this code.
index.js
Now, add these lines of code right below // CODE-GOES-HERE
.
Lastly, run node index.js
. It will run the AS function, get the result, and log it.
Yay! You made your first AssemblyScript app! Now, try and see if you can make a a subtraction function!
Here's a few hints:
Make sure to recompile:
npm run asbuild
Rewrite the add function to do subtraction
Make sure to change the index.js file
Last updated