Skip to content

Commit

Permalink
Fixed some small bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschmedtmann committed Jan 19, 2021
1 parent 838e450 commit 9f1ffbc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
6 changes: 5 additions & 1 deletion 12-Numbers-Dates-Timers-Bankist/final/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,11 @@ btnClose.addEventListener('click', function (e) {
let sorted = false;
btnSort.addEventListener('click', function (e) {
e.preventDefault();
displayMovements(currentAccount.movements, !sorted);
// BUG in video:
// displayMovements(currentAccount.movements, !sorted);

// FIX:
displayMovements(currentAccount, !sorted);
sorted = !sorted;
});

Expand Down
11 changes: 7 additions & 4 deletions 14-OOP/final/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ console.log(jessica.__proto__ === PersonCl.prototype);
jessica.greet();
// 1. Classes are NOT hoisted
// 2. Classes are first-class citizes
// 2. Classes are first-class citizens
// 3. Classes are executed in strict mode
const walter = new PersonCl('Walter White', 1965);
Expand Down Expand Up @@ -468,11 +468,15 @@ StudentProto.init = function (firstName, birthYear, course) {
};
StudentProto.introduce = function () {
console.log(`My name is ${this.fullName} and I study ${this.course}`);
// BUG in video:
// console.log(`My name is ${this.fullName} and I study ${this.course}`);
// FIX:
console.log(`My name is ${this.firstName} and I study ${this.course}`);
};
const jay = Object.create(StudentProto);
jay.init('Jay', 2010, 'Compuetr Science');
jay.init('Jay', 2010, 'Computer Science');
jay.introduce();
jay.calcAge();
Expand Down Expand Up @@ -644,4 +648,3 @@ rivian
console.log(rivian.speedUS);
*/

7 changes: 6 additions & 1 deletion 16-Asynchronous/final/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,12 @@ const whereAmI = async function () {
const res = await fetch(
`https://restcountries.eu/rest/v2/name/${dataGeo.country}`
);
if (!resGeo.ok) throw new Error('Problem getting country');
// BUG in video:
// if (!resGeo.ok) throw new Error('Problem getting country');
// FIX:
if (!res.ok) throw new Error('Problem getting country');
const data = await res.json();
console.log(data);
Expand Down

0 comments on commit 9f1ffbc

Please sign in to comment.