Solved Daydreams of Scope
-
Does anyone know…
Is there an situation where there is a difference between writing code directly interface.js, and within a file that's included in interface.js?
What is the difference (in scope) between declaring a variable as const and global? (I'm guessing that only the global variables can be accessed in the real-time thread, etc.)
What is the difference between const and const var?
-
@clevername27 said in Daydreams of Scope:
Is there an situation where there is a difference between writing code directly interface.js, and within a file that's included in interface.js?
This bug - https://forum.hise.audio/topic/10929/console-blink-not-blinking/17 -apart from that I don't think so.
@clevername27 said in Daydreams of Scope:
What is the difference (in scope) between declaring a variable as const and global? (I'm guessing that only the global variables can be accessed in the real-time thread, etc.)
A const variable is one that's value cannot be changed after declaration.
A global variable can be accessed from all script processors, not just the one in which it was created - and they make code messy so avoid them if you can (although some people, cough cough... Aaron, likes them) :)@clevername27 said in Daydreams of Scope:
What is the difference between const and const var?
The second one takes up more space on the screen. Other than that no difference. My OCD makes me remove the var.
-
@d-healey Thank you as always.
-