Skip to content

Commit b124f10

Browse files
committed
update 2- Explaining the error, prediction, and fix
1 parent 2583b44 commit b124f10

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

  • Sprint-3/1-key-errors

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
// console.log(decimalNumber);
1717

1818
// =============> write your explanation here
19-
// I moved `const decimalNumber = 0.5` outside the function. The function already has `decimalNumber` as a parameter, so I can pass a number directly when calling it, like `convertToPercentage(7)`. The function then multiplies it by 100 and adds `%`.
19+
// I removed the separate decimalNumber variable because the function already accepts decimalNumber as a parameter. I can now pass a number directly when calling the function, such as convertToPercentage(7). The function multiplies the value by 100 and appends % to return the percentage.
2020

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

23-
const decimalNumber = 0.5;
2423

2524
function convertToPercentage(decimalNumber) {
2625

0 commit comments

Comments
 (0)