Skip to content

Commit c234195

Browse files
comitting changes to march the reviewer suggestions
1 parent 4435e7f commit c234195

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// =============> write your prediction here
33
/*
44
I predict the function will throw a SyntaxError as the variable str has already been declared in the function parameter
5-
function capitalize will capitalise the first letter with index 0
5+
function capitalise will capitalise the first letter with index 0
66
and will append the sliced string from index 1 which is the second letter
77
*/
88

@@ -25,8 +25,8 @@ As we can see the str variable has already been declared in the prameter of the
2525
As we can see the str variable has already been declared in the prameter of the function instead we just return the value */
2626

2727
function capitalise(str) {
28-
return str[0].toUpperCase()+str.slice(1);
28+
return str[0].toUpperCase()+str.slice(1);
2929

3030
}
31-
capitalise("ebrahim");
32-
capitalise('salomi');
31+
console.log(capitalise("ebrahim"));
32+
console.log(capitalise('salomi'));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ function getLastDigit(num) {
4343
/* the reason why getLastDigit isn't working properly is that it doesn't accept any arrguments where there isn't any perameters in its difination.
4444
where it uses the golabal varaible 'num' decalred outside the funtion and already set to 103
4545
46-
The correct code includes a parameter 'number' in the difination this allows the function to accept the number passed to it when called*/
46+
The correct code includes a parameter 'num' in the difination this allows the function to accept the number passed to it when called*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// It should return their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18-
let result = Number(weight/(height*height));
19-
return result.toFixed(1);
18+
let result = (weight/(height*height));
19+
return Number(result.toFixed(1));
2020

2121

2222
}

0 commit comments

Comments
 (0)