0
    
          
  
  
    
            Why was "void" inserted?
If I attach the following code to a button
let a := 1;
    if 1 = 1 then
     a := 2
end;
alert(a);
a
it works as expected i.e. 2 is displayed
if I replace "a:=2" by "let a:=2" or "var a:=2" I get
let a := 1;
if 1 = 1 then
    var a := 2;
    void
end;
alert(a);
a
1 is displayed as expected
Why was "void" inserted?
1 reply
- 
  I think the compiler/transpiler is letting you know the code doesn't do anything. I assume this is a test of variable scope. Here's another one :) let a := 2;let b := 3;if 1 = 1 thenlet a := 1;b := 5end;alert(a)
Content aside
- 5 yrs agoLast active
- 1Replies
- 703Views
