Put comments into example scripts.

This commit is contained in:
Stephen Chung
2020-03-16 14:50:12 +08:00
parent 42ecae4366
commit d4311bddb0
17 changed files with 119 additions and 68 deletions

View File

@@ -1,5 +1,12 @@
// This script defines a function with two parameters
let a = 3;
fn addme(a, b) {
a+b
a = 42; // notice that 'a' is passed by value
a + b; // notice that the last value is returned even if terminated by a semicolon
}
print(addme(3, 4))
print(addme(a, 4)); // should print 46
print(a); // should print 3 - 'a' is never changed