summary refs log tree commit diff
path: root/examples/5.src
blob: 5d6baaa7749969bbc0f29f449571e39c3d654722 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* As you see, the language supports variable scopes */

let x = 18;

let foo = () => {
	let x = 1;
	print(x);
	return x;
};

let main = () => {
	print(x);
	let x = 2;
	let y= foo();
	print(x);
	return x + y;
};