-
Notifications
You must be signed in to change notification settings - Fork 0
/
dotNotation.js
55 lines (47 loc) · 1.38 KB
/
dotNotation.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
console.log("hello".toUpperCase());
console.log("hello".toLowerCase());
console.log(Math.floor(Math.random()*10));
// TASK 1//
// BASIC LONG //
console.log (" | | ")
console.log (" | | ")
console.log (" | | ")
console.log ("- - - - - - - -")
console.log (" | | ")
console.log (" | | ")
console.log (" | | ")
console.log ("- - - - - - - -")
console.log (" | | ")
console.log (" | | ")
console.log (" | | ")
// VARIABLE WITH AN OR STATEMENT //
let lineVertical = " | | ";
let lineHorizontal = "- - - - - - - -";
for (let i = 0; i < 9; i++) {
if (i == 3 || i == 6){
console.log(lineHorizontal)
}
console.log(lineVertical)
}
// ARRAY VERSION //
let lineArray = [" | | ", "- - - - - - - -"];
for (let i = 0; i < 9; i++) {
if (i == 3 || i == 6){
console.log(lineArray[1])
}
console.log(lineArray[0])
}
// ADAMS VERSION //
myArr = []
for(let i = 0; i < 3; i++){
for(let j = 0; j < 3; j++){
if(i !== 3 ? true : false){
myArr.push(" | | ");
}
if(j !== 2 ? true : false){
myArr.push("--------------");
}
console.log(myArr[0]);
}
console.log(myArr[1]);
}