Skip to content

Commit

Permalink
updateweek2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayman-matoo committed Nov 28, 2023
1 parent 328e5cf commit a54967b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion week-2/errors/0.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// interpret the error message and figure out why it's happening, if your prediction was wrong

function capitalise(str) {
let str = `${str[0].toUpperCase()}${str.slice(1)}`;
str = `${str[0].toUpperCase()}${str.slice(1)}`;
return str;
}
// variable name without let
3 changes: 3 additions & 0 deletions week-2/errors/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ function convertToPercentage(decimalNumber) {
}

console.log(decimalNumber);
// you can't declare constant with the same name as a parameter within the same scope
// decimalNumber is not defined.
// value numbers should not take string
3 changes: 3 additions & 0 deletions week-2/errors/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

function square(3) {
return num * num;
console.log (square(3));//12
console.log (square(6));//18
}



1 change: 1 addition & 0 deletions week-2/implement/bmi.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
// Given someone's weight in kg and height in metres
// When we call this function with the weight and height
// Then it returns their Body Mass Index to 1 decimal place

0 comments on commit a54967b

Please sign in to comment.