But as mentioned, this doesn’t actually render that image, but instead it produces some output that can be used to render that image. That’s an important distinction, and you can see the actual output by adding in the render function and telling it to produce debug output. For example:
You may need to expand the element’s size to see the whole output.
Canvas uses the output to render an element, but other applications can use expressions to do pretty much anything. As stated previously, expressions simply execute functions, and the functions are all written in Javascript. That means if you can do something in Javascript, you can do it with an expression.
- Sending emails
- Reading from a file
- Writing to a file
- Consuming external APIs
If your Javascript works in the environment where the code will run, such as in Node.js or in a browser, you can do it with an expression.