|
It's looks like the global variable behavior is more like running the code block before. For example, when I save a random number, the number change every time I run the second code block (not the marked global block). For what is the "Reset globals" button, when it's rerun the code every time? |
Answered by
alagrede
Nov 8, 2022
Replies: 1 comment
|
Hi 👋, |
0 replies
Answer selected by
alagrede
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi 👋,
Yes, global code blocks can be used to store a shared variable (so to share code, not results). The "reset globals" button is used to erase global code blocks from memory.
Documentation here: https://doc.notebookjs.app/#/magic_comments?id=global-variable
Usage example here: https://github.com/alagrede/znote-app/blob/master/examples/climate-active-fires.md