-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs2Codeup.js
More file actions
54 lines (33 loc) · 743 Bytes
/
js2Codeup.js
File metadata and controls
54 lines (33 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function shout(message) {
alert(message.toUpperCase() + "!!!");
}
var returnValue = shout('hello there');
console.log(returnValue);
function sayHello() {
alert('hello there!');
}
sayHello("codeup");
var globalVar = "Look, I'm Global!";
function sayHello() {
alert(globalVar);
}
sayHello();
var globalVar = "Look, I'm Global!";
function scopeExample() {
var localVar = "Look, I'm Local!";
alert(localVar);
alert(globalVar);
}
scopeExample();
alert(localVar);
var x = 400;
var y = 200;
function scopeExample() {
var x = 5;
var y = 2;
console.log('x: ' + x + ' y: ' + y);
return x + y;
}
console.log('x: ' + x + ' y: ' + y);
var returnValue = scopeExample();
console.log(returnValue);