Skip to content

Commit 227ab10

Browse files
committed
Debugging codes
1 parent 70c5711 commit 227ab10

12 files changed

+77
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let a = 5;
2+
let b = 1;
3+
a++;
4+
5+
6+
let sumAB = a + b;
7+
console.log(a);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
let output = "Get this to show once in the freeCodeCamp console and not at all in the browser console";
2+
console.log(output);
3+
console.clear();
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
let seven = 7;
2+
let three = "3";
3+
console.log(seven + three);
4+
console.log(typeof seven);
5+
console.log(typeof three);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
let receivables = 10;
2+
let payables = 8;
3+
let netWorkingCapital = receivables - payables;
4+
console.log(`Net working capital is: ${netWorkingCapital}`);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
let myArray = [1, 2, 3];
2+
let arraySum = myArray.reduce((previous, current) => previous + current);
3+
console.log(`Sum of array values is: ${arraySum}`);
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
let innerHtml = "<p>Click here to <a href='#Home'>return home</a></p>";
2+
console.log(innerHtml);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
let x = 7;
2+
let y = 9;
3+
let result = "to come";
4+
5+
result = x === y ? "Equl!" : "Not equal!"
6+
7+
console.log(result);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function getNine() {
2+
let x = 6;
3+
let y = 3;
4+
return x + y;
5+
}
6+
7+
let result = getNine();
8+
console.log(result);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function raiseToPower(b, e) {
2+
return Math.pow(b, e);
3+
}
4+
5+
let base = 2;
6+
let exp = 3;
7+
let power = raiseToPower(base, exp);
8+
console.log(power);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function countToFive() {
2+
let firstFive = "12345";
3+
let len = firstFive.length;
4+
for (let i = 0; i < len; i++) {
5+
console.log(firstFive[i]);
6+
}
7+
}
8+
9+
countToFive();

0 commit comments

Comments
 (0)