Skip to content

Commit dd9daab

Browse files
committed
I have correct all the mistakes
1 parent a6db6fb commit dd9daab

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Sprint-1/1-key-exercises/1-count.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ count = count + 1;
44

55
// line 1 makes box called count and puts 0 inside it.
66
// line 3 adds 1 to count.
7+
//Line 3 is an increment operation because it increases the value of the variable count by 1.
8+

Sprint-1/2-mandatory-errors/3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ const last4Digits = cardNumber.slice(-4);
1212
// The code will not work because slice() cannot be used on numbers.
1313
// Slice() only works on strings or arrays.
1414
//We need to convert the number to string first
15-
const last4Digits = cardNumber.to String().slice(-4);
15+
const last4Digits = cardNumber.toString().slice(-4);

Sprint-1/3-mandatory-interpret/1-percentage-change.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ let carPrice = "10,000";
22
let priceAfterOneYear = "8,543";
33

44
carPrice = Number(carPrice.replaceAll(",", ""));
5-
priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
5+
priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", ""));
66

7-
const PriceDifference = carPrice - priceAfterOneYear;
8-
const PercentageChange = (PriceDifference / carPrice) * 100;
7+
const priceDifference = carPrice - priceAfterOneYear;
8+
const percentageChange = (priceDifference / carPrice) * 100;
99

10-
console.log(`The percentage change is ${PercentageChange}`);
10+
console.log(`The percentage change is ${percentageChange}`);
1111

1212
// Read the code and then answer the questions below
1313

@@ -23,8 +23,8 @@ Number(priceAfterOneYear.replaceAll(",", ""))
2323
// the error is comin from this line
2424

2525
priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
26-
// the error happens becuae there is missing comma inside reaplaceAll().
27-
//The correct line should be
26+
// The error happens because a comma is missing between the arguments in the replaceAll() function.
27+
// The correct line should be
2828
priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", ""));
2929

3030
// c) Identify all the lines that are variable reassignment statements

0 commit comments

Comments
 (0)