@TeresaHolfeld/

HugeNocturnalDatasets

Nodejs

No description

fork
loading
Files
  • index.js
  • exercise.js
index.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
console.log("Hello World!");

var myName = "Teresa";
console.log(myName);

var myName = "Teresa";
var text = "Hello my name is " + myName;
console.log(text);

var number = 5;
console.log(number);

var floatNumber = 2.14;
console.log(floatNumber);

var myName = "Teresa";
var age = 32;
var text = "My name is " + myName + " and I am " + age + " years old";
console.log(text);

var canCode = false;
console.log(canCode);

var myName = "Teresa";
var canCode = true;
var text = myName + " can code: " + canCode;
console.log(text);

var a = 12;
var b = 5;
console.log("The sum is ", a + b);

var a = 12;
var b = 5;
console.log("The difference is ", a - b);

var a = 12;
var b = 5;
console.log("The product is ", a * b);

var a = 12;
var b = 5;
console.log("The product is ", a * b);

var a = 12;
var b = 5;
var ratio = a / b;
console.log("Division: ", ratio);

var a = 12;
var b = 5;
var modulo = a % b;
console.log("Modulo: ", modulo);

var userAge = 21;
if (userAge >= 18) {
  console.log("Have a Beer!");
} else {
  console.log("Have a Fritz!");
}

var a = 12;
var b = 5;

var result = a == b;

console.log(result);

var userAge = 21;
var isOldEnough = userAge >= 18;
if (isOldEnough) {
  console.log("Have a Beer!");
} else {
  console.log("Have a Soda!");
}

var userAge = 17;
var withParentalGuidance = true;
if ((userAge >= 18) || (userAge >= 16 && withParentalGuidance)) {
  console.log("Have a Beer!");
}

var userAge = 17;
var withParentalGuidance = true;
if (!(userAge < 18) || (userAge >= 16 && withParentalGuidance)) {
  console.log("Have a Beer!");
}

var userAge = 17;
var withParentalGuidance = true;
if (userAge >= 18) {
  console.log("Have a Beer!");
} else if (userAge >= 16 && withParentalGuidance) {
  console.log("Max 2 beers!");
} else {
  console.log("Have a Soda!");
}

var a = 3;
var b = 7;
var c = 5;

if (a > b) {
  // B IS OUT
  if (a > c) {
    console.log(a);
  } else {
    console.log(c);
  }
} else {
  // A IS OUT
  if (b > c) {
    console.log(b);
  } else {
    console.log(c);
  }
}
node v10.16.0