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,15 +1,17 @@
let arr = [1,2,3,4]
for a in arr {
for b in [10,20] {
print(a)
print(b)
}
if a == 3 {
break;
}
}
//print(a)
// This script runs for-loops
for i in range(0,5) {
print(i)
}
let arr = [1,2,3,4];
for a in arr {
for b in [10, 20] {
print(a + "," + b);
}
if a == 3 { break; }
}
//print(a); // <- if you uncomment this line, the script will fail to run
// because 'a' is not defined here
for i in range(0, 5) { // runs through a range from 1 to 5 exclusive
print(i);
}