Skip to content

Commit 658f361

Browse files
committed
Changes according to PR review.
1 parent 44e08de commit 658f361

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

Sprint-2/1-key-errors/0.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ function capitalise(str) {
1313
// =============> write your explanation here. My explanation: We have to change the name of variable and return it in order to fix an error.
1414
// =============> write your new code here
1515
function capitalise(str) {
16-
let strChanged = `${str[0].toUpperCase()}${str.slice(1)}`;
17-
return strChanged;
16+
return `${str[0].toUpperCase()}${str.slice(1)}`;
1817
}
1918
console.log(capitalise("some string"));

Sprint-2/1-key-errors/1.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ console.log(decimalNumber);
2121
// =============> write your new code here
2222

2323
function convertToPercentage(decimalNumber) {
24-
const percentage = `${decimalNumber * 100}%`;
25-
return percentage;
24+
return `${decimalNumber * 100}%`;
2625
}
2726

2827
console.log(convertToPercentage(0.1));

Sprint-2/2-mandatory-debug/0.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
1414
// Finally, correct the code to fix the problem
1515
// =============> write your new code here
1616
function multiply(a, b) {
17-
resultOfMultiply = a*b;
18-
return resultOfMultiply
17+
return a*b;
1918
}
2019

2120
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);

Sprint-2/2-mandatory-debug/1.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
1212
// Finally, correct the code to fix the problem
1313
// =============> write your new code
1414
function sum(a, b) {
15-
resultOfAdding = a + b;
16-
return resultOfAdding
15+
return a + b;
1716
}
1817

1918
console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);

Sprint-2/2-mandatory-debug/2.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`);
2323
const num = 103;
2424

2525
function getLastDigit(num) {
26-
let digit = num.toString().slice(-1);
27-
return digit
26+
return num.toString().slice(-1);
2827
}
2928
console.log(`The last digit of 42 is ${getLastDigit(42)}`);
3029
console.log(`The last digit of 105 is ${getLastDigit(105)}`);

Sprint-2/3-mandatory-implement/1-bmi.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
function calculateBMI(weight, height) {
1818
// return the BMI of someone based off their weight and height
19-
resultBmi = weight/Math.pow(height,2);
20-
return resultBmi.toFixed(1);
19+
return weight/Math.pow(height,2);
2120
}
2221
console.log(calculateBMI(70, 1.73));

0 commit comments

Comments
 (0)