-
Notifications
You must be signed in to change notification settings - Fork 0
/
module-flow.js
62 lines (51 loc) · 1020 Bytes
/
module-flow.js
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//module-flow.js
//Importing modules
var prim_datatypes = require("./prim-datatypes");
var name = "Zach";
console.log(name);
//print object passed back from module
console.log(prim_datatypes);
//Flow contorl
//if statement
//same datatype and value
if(1 === 1){
//true
console.log("t");
}
//same value
if(1 == 1){
//true
console.log("t");
}
//Greater than or equal to
if(1 >= 0){
//true
console.log("t");
}
//Greater than
if(1 > 0){
//true
console.log("t");
}
//Less than
if(1 < 0){
//Do nothing
console.log("Do nothing");
}else if(1 > -1){
//True the last one doesn't happen
console.log("this get\'s printed");
}else if(true){
//True the last one doesn't happen
console.log("this doens't get printed either");
}else{
//Since the top 'else if' evaluates to true, this code block doens't run
console.log("this is not printed");
}
//continue
//loops
//for loop
var iii = 0;
var end = 5;
for(iii=0;iii<end;iii++){
console.log(iii);
}