+Functions weren't made for doing this, so as you can imagine, there are a few restrictions. First off, you only get one point of memory, called the state (which also acts as your output). You can define variables, but they can only be read from, so they act a bit more for convenience. Even so, two functions can technically have two distinct states, although they will need to combine them somehow before the function returns. On that note, early returns, or any kind of jumps, are also impossible. This effects LogiMat's internals as well, and as such means that every code path is executed, but only the needed values are actually returned. Keep this in mind, as if any code paths return undefined, the entire function will return undefined (you can use safe functions, such as `safeDivide`, `safeLog`, etc to avoid this).
0 commit comments