Looking at the underlying technology of C2 (HTML5 / Javascript), I notice that all variables are ultimately without a type in their definition
JavaScript uses dynamic typing most of the time, yes. That could lead to some interesting conversation, but that's not really my point. I didn't intend to get into any discussions of JS technology, language implementations, and/or script parsing/interpretation/compilation.
With that said, I guess the Construct 2 editor tries to at least provide some structure by allowing variables to be specifically set to number or text.
This statement sort of leads towards my original point. This "structure" is for the "convenience" of the "no programming" game developer, not the eventual JS run-time code.
It seems possible to add the "type" of Boolean, but they probably also decided it was unnecessary due to the ability of Javascript to perform Boolean checks for most data types
Not only "possible," but "they" already DID!
That in fact, IS my "original" point: C2 ALREADY supports a "Boolean" interface & dialogs for Instance Variables (only), so why not for Global & Local Variables as well ? THAT is my question ...
So, they probably figured it's easier to just invert a condition that checks "if X = 0" than to bother with all the extra code to support a fake type, that would lower performance during execution if it were enforced via variables declared as objects.
Ok, I'm just guessing here, but it seems that the "enforcement" would be during the "design & development" using C2, not necessarily in the exported JS run-time code; if you "enforce" the "Boolean" within the design interface (C2 Boolean dialogs when "declared" as such Instance Variables), then you prevent the user from "accidentally" using it in any other manner, so as C2 generates the actual JS code on export, it should be able to guarantee that consistency. Exactly HOW the "Boolean" is "implemented" in the generated JS code ("if X=0" or whatever) should need be of NO concern to the game developer, as long as he does not (or is unable) to "mix" the types ...
(Now, I'm by no means any kind of "expert" in the use of C2, but I'm also guessing that there are other ways of bypassing those "interface" restrictions, but then, you're getting closer to "real code" as opposed to the "no programming" mantra of C2) ...
Once more, my only real issue here is:
When it fits my design, I'd like to use a "Boolean" interface & dialog(s) for Global & Local Variables, in the same manner as already supported for Instance Variables, so why NOT ? ...