Sharing variables between Javascript and Twine is a bit like coordinating tea with donkey and piggy — tricky, but not impossible.

The key is to understand how Twine leverages its wikifier foundation layer to pass information.

I could write an exhaustive post explaining the logic at play using obtuse metaphors (see paragraph one), but instead, I created a heavily commented example you can leverage for your own projects that you can download here.

☕️ 🐷