Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c48f278
Update jl-errors-formatting.md
ramzisalem Jun 16, 2019
2be05d6
Update jl-errors-formatting.md
ramzisalem Jun 16, 2019
4de1e5f
Update jl-errors-formatting.md
ramzisalem Jun 16, 2019
6196508
Update jl-variables-swaps.md
ramzisalem Jun 16, 2019
a9b0dd7
Update jl-variables-multiple.md
ramzisalem Jun 16, 2019
0959e64
Update jl-variables-swaps.md
ramzisalem Jun 16, 2019
70dc195
Update jl-variables-swaps.md
ramzisalem Jun 16, 2019
c479f88
Update fcc-basic-js-pt-1.md
ramzisalem Jun 16, 2019
03199de
Update fcc-basic-js-pt-1.md
ramzisalem Jun 16, 2019
05b1b10
Update fcc-basic-js-pt-1.md
ramzisalem Jun 16, 2019
b7e95eb
Update fcc-debugging.md
ramzisalem Jun 18, 2019
1cf017d
Update fcc-debugging.md
ramzisalem Jun 18, 2019
600fa1b
Update fcc-debugging.md
ramzisalem Jun 18, 2019
1f313ea
Update fcc-debugging.md
ramzisalem Jun 18, 2019
1299912
Update jl-errors-primitive-types.md
ramzisalem Jun 18, 2019
92ab47e
Update jl-errors-primitive-types.md
ramzisalem Jun 18, 2019
115c066
Update jl-errors-variables.md
ramzisalem Jun 18, 2019
e7aaa69
Update jl-functions.md
ramzisalem Jun 18, 2019
d4fb2b4
Update jl-turtle-shuffle.md
ramzisalem Jun 18, 2019
c87cfda
Update jl-functions.md
ramzisalem Jun 18, 2019
fe1de6a
Update jl-variables-swaps.md
ramzisalem Jun 21, 2019
1f1e416
Update jl-variables-multiple.md
ramzisalem Jun 21, 2019
ccf271a
Update jl-variables-multiple.md
ramzisalem Jun 23, 2019
0d08b65
Update jl-variables-swaps.md
ramzisalem Jun 23, 2019
385140f
Update README.md
ramzisalem Jun 23, 2019
9ffba49
Update README.md
ramzisalem Jun 23, 2019
0607bf9
Update jl-functions.md
ramzisalem Jun 23, 2019
9c1e14b
Update jl-variables-swaps.md
ramzisalem Jun 23, 2019
8738bee
Update jl-turtle-shuffle.md
ramzisalem Jun 23, 2019
269e3b4
Merge pull request #3 from be-hacking-hyf/master
ramzisalem Jun 26, 2019
6f2ffc1
Update jl-errors-arrays.md
ramzisalem Jun 26, 2019
3c9cb6e
Update jl-errors-arrays.md
ramzisalem Jun 26, 2019
74c07ae
Update jl-errors-const.md
ramzisalem Jun 26, 2019
48a07e7
Update jl-errors-objects.md
ramzisalem Jun 26, 2019
a296aeb
Update jl-errors-objects.md
ramzisalem Jun 26, 2019
eac624f
Update jl-functions-ref-type-args.md
ramzisalem Jun 26, 2019
5d59903
Update fcc-basic-js-pt-2.md
ramzisalem Jun 26, 2019
1d26500
Update fcc-data-structures.md
ramzisalem Jun 27, 2019
510d2c8
Update jl-functions-ref-type-args.md
ramzisalem Jun 29, 2019
2ff6286
Update jl-reference-types.md
ramzisalem Jun 29, 2019
b7ccc0d
Update jl-reference-types.md
ramzisalem Jun 29, 2019
2ea90bb
Update jl-variables-sentences-1.md
ramzisalem Jun 29, 2019
d8ae612
Update jl-variables-sentences-1.md
ramzisalem Jun 29, 2019
e70bcce
Update jl-variables-sentences-2.md
ramzisalem Jun 29, 2019
a38e4dd
Update jl-variables-sentences-2.md
ramzisalem Jun 29, 2019
76d8415
Update jl-variables-sentences-2.md
ramzisalem Jun 29, 2019
eb8a1a1
Update js-tracing-conditionals.md
ramzisalem Jun 29, 2019
f9e8e15
Update jl-loop-refactors.md
ramzisalem Jun 29, 2019
b8c13d2
Update js-tracing-conditionals.md
ramzisalem Jun 29, 2019
660ec7c
Update jsinfo-objects.md
ramzisalem Jun 29, 2019
b70fd44
Update jsinfo-objects.md
ramzisalem Jun 29, 2019
448746a
Update README.md
ramzisalem Jun 29, 2019
d5ce648
Update jl-functions-ref-type-args.md
ramzisalem Jun 30, 2019
78aaf4d
Merge pull request #5 from be-hacking-hyf/master
ramzisalem Jun 30, 2019
24589da
Update jl-replicate-loose-equality.md
ramzisalem Jun 30, 2019
efe80af
Update README.md
colevandersWands Jul 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions week-1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

| | your Emoji | your comments | coach emoji | coach comments |
| --- | --- | --- | --- | --- |
| :seedling: __[fcc basics](./fcc-basic-js-pt-1.md)__: through ```Counting Cards``` | | | | |
| :dash: __[fcc debugging](./fcc-debugging.md)__ | | | | |
| :seedling: __[errors: formatting](./jl-errors-formatting.md)__ | | | | |
| :seedling: __[errors: primitives](./jl-errors-primitive-types.md)__ | | | | |
| :seedling: __[errors: variables](./jl-errors-variables.md)__ | | | | |
| :seedling: __[varibales: swaps](./jl-variables-swaps.md)__ | | | | |
| :dash: __[variables: multiple assignments](./jl-variables-multiple.md)__ | | | | |
| :seedling: __[how functions work](./jl-functions.md)__ | | | | |
| :dash: __[functions: turtle shuffle](./jl-turtle-shuffle.md)__ | | | | |
| :seedling: __[fcc basics](./fcc-basic-js-pt-1.md)__: through ```Counting Cards``` | ⚠️ | Still working on it, I will do it multiple times to be stucked in my mind | | |
| :dash: __[fcc debugging](./fcc-debugging.md)__ | ✅ | easily done! | | |
| :seedling: __[errors: formatting](./jl-errors-formatting.md)__ | ✅ | Perfect! | | |
| :seedling: __[errors: primitives](./jl-errors-primitive-types.md)__ | ✅ | All is okay | | |
| :seedling: __[errors: variables](./jl-errors-variables.md)__ | ✅ | It's okay | | |
| :seedling: __[varibales: swaps](./jl-variables-swaps.md)__ | ✅ | it was interesting | | |
| :dash: __[variables: multiple assignments](./jl-variables-multiple.md)__ | ✅ | done | | |
| :seedling: __[how functions work](./jl-functions.md)__ | ✅ | so important to understand | | |
| :dash: __[functions: turtle shuffle](./jl-turtle-shuffle.md)__ | ✅ | easily done | | |

---

Expand Down
9 changes: 9 additions & 0 deletions week-1/fcc-basic-js-pt-1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
> complete [the basic JS exercises](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript) through _Counting Cards_ & paste each of your solutions into this file. This will allow you to use your FCC exercises as a study reference later on
> [completed example](https://github.com/AlfiYusrina/hyf-javascript1/blob/master/week1/freecode_camp_solutions.MD)


## 1. Comment Your Code

```js
// This is Ramzi, in-line comment :)
/* This is Ramzi,
multi-line comment */
```

149 changes: 149 additions & 0 deletions week-1/fcc-debugging.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,152 @@
> begin [the debugging exercises](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/debugging) and paste each of your solutions into this file. This will allow you to use your FCC exercises as a study reference later on
> [completed example](https://github.com/AlfiYusrina/hyf-javascript1/blob/master/week1/freecode_camp_solutions.MD) (wrong exercises, correct markdown styling)

# Homework
## 1. Debugging: Use the JavaScript Console to Check the Value of a Variable

```js
let a = 5;
let b = 1;
a++;
// Add your code below this line


let sumAB = a + b;
console.log(a);
```
## 2. Debugging: Understanding the Differences between the freeCodeCamp and Browser Console

```js
// Open your browser console
let outputTwo = "This will print to the browser console 2 times";
// Use console.log() to print the outputTwo variable


let outputOne = "Try to get this to log only once to the browser console";
// Use console.clear() in the next line to print the outputOne only once


// Use console.log() to print the outputOne variable

console.log(outputTwo)
console.log(outputOne)
console.clear()
```

## 3.Debugging: Use typeof to Check the Type of a Variable
```js
let seven = 7;
let three = "3";
console.log(seven + three);
// Add your code below this line
console.log(typeof seven)
console.log(typeof three)
```

## 4. Debugging: Catch Misspelled Variable and Function Names
```js
let receivables = 10;
let payables = 8;
let netWorkingCapital = receivables - payables;
console.log(`Net working capital is: ${netWorkingCapital}`);
```

## 5. Debugging: Catch Unclosed Parentheses, Brackets, Braces and Quotes
```js
let myArray = [1, 2, 3];
let arraySum = myArray.reduce((previous, current) => (previous + current));
console.log(`Sum of array values is: ${arraySum}`);
```

## 6. Debugging: Catch Mixed Usage of Single and Double Quotes
```js
let innerHtml = "<p>Click here to <a href='#Home'>return home</a></p>";
console.log(innerHtml);
```

## 7. Debugging: Catch Use of Assignment Operator Instead of Equality Operator
```js
let x = 7;
let y = 9;
let result = "to come";

if(x == y) {
result = "Equal!";
} else {
result = "Not equal!";
}

console.log(result);
```

## 8. Debugging: Catch Missing Open and Closing Parenthesis After a Function Call
```js
function getNine() {
let x = 6;
let y = 3;
return x + y;
}

let result = getNine();
console.log(result);
```
## 9. Debugging: Catch Arguments Passed in the Wrong Order When Calling a Function
```js
function raiseToPower(b, e) {
return Math.pow(b, e);
}

let base = 2;
let exp = 3;
let power = raiseToPower(base, exp);
console.log(power);
```
## 10. Debugging: Catch Off By One Errors When Using Indexing
```js
function countToFive() {
let firstFive = "12345";
let len = firstFive.length;
// Fix the line below
for (let i = 0; i < len; i++) {
// Do not alter code below this line
console.log(firstFive[i]);
}
}

countToFive();
```

## 11. Debugging: Use Caution When Reinitializing Variables Inside a Loop
```js
function zeroArray(m, n) {
// Creates a 2-D array with m rows and n columns of zeroes
let newArray = [];
let row = [];
for (let i = 0; i < m; i++) {
// Adds the m-th row into newArray
let row = [];

for (let j = 0; j < n; j++) {
// Pushes n zeroes into the current row to create the columns
row.push(0);
}
// Pushes the current row, which now has n zeroes in it, to the array
newArray.push(row);
}
return newArray;
}

let matrix = zeroArray(3, 2);
console.log(matrix);
```

## 12. Debugging: Prevent Infinite Loops with a Valid Terminal Condition
```js
function myFunc() {
while(false) {
for (let i = 1; i <= 4; i += 2) {
console.log("Still going!");
}
}
}
```
38 changes: 37 additions & 1 deletion week-1/jl-errors-formatting.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
> paste [this markdown](https://raw.githubusercontent.com/janke-learning/error-exercises/master/formatting.md) into this file and fix the errors!
> [completed example](https://github.com/AlfiYusrina/hyf-javascript1/blob/master/week1/errors_solutions.MD) (of the old version)
> references: [errors & life-cycle](https://github.com/janke-learning/errors-and-life-cycle), [exercise repo](https://github.com/janke-learning/errors)
> references: [errors & life-cycle](https://github.com/janke-learning/errors-and-life-cycle), [exercise repo](https://github.com/janke-learning/errors)

# Formatting Errors

It's easy to miss the little things, even when you're an experienced programmer! Using a linter will help enormously avoiding simple formatting errors, but it's still great practice to learn how to spot them yourself. This skill build your confidence writing code from a blank page and is important for those times when you're coding outside of your normal editor.

### exercises
* [improper end of statement](#improper-end-of-statement)

---

## improper end of statement
broken code:
```js
let a = 1:
```
error message:
```
Uncaught SyntaxError: Unexpected token :
```
classification:
* creation phase
* syntax

the fix:
```js
let a = 1;
```
your notes:
Notes always perfect!

[TOP](#formatting-errors)


___
___
### <a href="http://janke-learning.org" target="_blank"><img src="https://user-images.githubusercontent.com/18554853/50098409-22575780-021c-11e9-99e1-962787adaded.png" width="40" height="40"></img> Janke Learning</a>
86 changes: 85 additions & 1 deletion week-1/jl-errors-primitive-types.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,87 @@
> paste [this markdown](https://raw.githubusercontent.com/janke-learning/errors/master/primitive-types.md) into this file and fix the errors!
> [completed example](https://github.com/AlfiYusrina/hyf-javascript1/blob/master/week1/errors_solutions.MD) (of the old version)
> references: [errors & life-cycle](https://github.com/janke-learning/errors-and-life-cycle), [exercise repo](https://github.com/janke-learning/errors)
> references: [errors & life-cycle](https://github.com/janke-learning/errors-and-life-cycle), [exercise repo](https://github.com/janke-learning/errors)

# Primitive Type Errors

* [improper multi-line string](#improper-multi-line-string)
* [improper nested quotes 1](#improper-nested-quotes-1)
* [improper nested quotes 2](#improper-nested-quotes-2)

---

## improper multi-line string

broken code:
```js
let a = 'this is
two lines';
```
error message:
```
Uncaught SyntaxError: Invalid or unexpected token
```
classification:
* creation phase
* syntax

the fix:
```js
let a = "this is" +
"two lines" ;```
your notes:

[TOP](#primitive-type-errors)

---

## improper nested quotes 1

broken code:
```js
let innerHtml = "<p>Click here to <a href="#Home">return home</a></p>";
```
error message:
```
Uncaught SyntaxError: Unexpected identifier
```
classification:
* creation phase
* syntax

the fix:
```js
let innerHtml = "<p>Click here to <a href='#Home'>return home</a></p>";
```
your notes:

[TOP](#errors)

---

## improper nested quotes 2

broken code:
```js
let nested_messages = 'remind yourself ''i can do this!'' at least once a day';
```
error message:
```
Uncaught SyntaxError: Unexpected string
```
classification:
* creation phase
* syntax

the fix:
```js
let nested_messages = 'remind yourself' + 'i can do this!' + 'at least once a day';
```
your notes:

[TOP](#primitive-type-errors)

___
___
### <a href="http://janke-learning.org" target="_blank"><img src="https://user-images.githubusercontent.com/18554853/50098409-22575780-021c-11e9-99e1-962787adaded.png" width="40" height="40"></img> Janke Learning</a>

Loading