Using a standard WordPress block, you may be surprised how easy it is to embed javascript.
All you need to do is add an HTML block, add <script> and </script> tags, then put what you want between them.
Any javascript between the tags will execute as soon as the block is parsed.
For that reason, you may want the page’s elements with which the script will interact fully developed first, so the best place for the block would be at the bottom of the page.
Here’s an example from the Understanding Colors post:

Notice that the first two elements above are also HTML blocks which were used to create the divs on which the javascript will operate.
Here it is in operation:
See also: How To Build A Converter