Skip to content

Commit ed4e7a2

Browse files
committed
updated files from the last run
1 parent 3365fc9 commit ed4e7a2

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
// Means Function identifier should be a name not a number =============> explain this error message here.
1414
// Whats the difference between function identifier and parameter?
15-
// I believe function and identifier and parameter can be used interchangeably. So Parsing number 3 into the parameter would throw an error.
15+
// The parameter of a function must be name not number. So Parsing number 3 into the parameter would throw an error.
1616
// Changing number 3 to 'num' as a placeholder fixes the error
1717

1818
// Finally, correct the code to fix the problem
1919

2020
// =============> write your new code here
2121

2222
function square(num) {
23-
return (square = num * num);
23+
return num * num;
2424
}
2525
console.log(square(3));

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ function calculateBMI(weight, height) {
1919
}
2020

2121
function calculateBMI(weight, height) {
22-
// return (weight / height).toFixed(1); - 1st attempt
23-
return (weight / (height * height)).toString().slice(0, 4);
22+
//return (weight / height).toFixed(1); - 1st attempt
23+
//return (weight / (height * height)).toString().slice(0, 4); - 2nd attempt
24+
return "${(weight / (height * height)).toFixed(1)}";
2425
}
2526

2627
console.log(`the bmi of 70 and 2.99 is ${calculateBMI(70, 2.99)}`);

‎Sprint-3/3-mandatory-implement/2-cases.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ console.log(text);
2626

2727
// Trim and regex pattern was the only saving grace I came across to resolve the underscore issue I had spent hours researching.
2828
// I have however now modified and replaced the pattern for easy understanding with AI's help
29+
// CodeYourFuture AI Usage Guide reviewed again

0 commit comments

Comments
 (0)