Skip to content

Commit 4ff0efb

Browse files
committed
formatted Document for all files.
1 parent 15661f3 commit 4ff0efb

18 files changed

Lines changed: 23 additions & 60 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ count = count + 1;
66
// Describe what line 3 is doing, in particular focus on what = is doing
77

88
//= mean assignment operator. Computer will calculate the result of "count + 1" and update the variable with the result.
9-
//In this question, variable "count" changed from 0 to 1.
9+
//In this question, variable "count" changed from 0 to 1.

‎Sprint-2/1-key-exercises/2-initials.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ const lastName = "Johnson";
88
const initials = `${firstName.charAt(0)}${middleName.charAt(0)}${lastName.charAt(0)}`;
99

1010
// https://www.google.com/search?q=get+first+character+of+string+mdn
11-
console.log(initials)
11+
console.log(initials);

‎Sprint-2/1-key-exercises/3-paths.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ console.log(`The base part of ${filePath} is ${base}`);
2020
const dir = filePath.slice(0, lastSlashIndex);
2121
const ext = base.slice(base.lastIndexOf(".") + 1);
2222

23-
console.log(ext)
23+
console.log(ext);
2424

25-
// https://www.google.com/search?q=slice+mdn
25+
// https://www.google.com/search?q=slice+mdn

‎Sprint-2/1-key-exercises/4-random.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
88
// It will help to think about the order in which expressions are evaluated
99
// Try logging the value of num and running the program several times to build an idea of what the program is doing
1010

11-
console.log(num)
11+
console.log(num);
1212

1313
//math.floor is round down the number returns to largest integer less than or equal to a given number.
1414
//math.random() could generate the number from 0 to <1 b random.
1515
//maximum refer to 100 and minimum refer to 1.
16-
//The calculation of num is different everytime because of math.random(). smallest value of num is 1. And largest is 100.
16+
//The calculation of num is different everytime because of math.random(). smallest value of num is 1. And largest is 100.

‎Sprint-2/2-mandatory-errors/0.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
This is just an instruction for the first activity - but it is just for human consumption
2-
We don't want the computer to run these 2 lines - how can we solve this problem?
1+
//This is just an instruction for the first activity - but it is just for human consumption
2+
//We don't want the computer to run these 2 lines - how can we solve this problem?
33

4-
//adding // before the lines.
4+
//adding // before the lines.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
let age = 33;
44
age = age + 1;
55

6-
console.log(age)
6+
console.log(age);
77

8-
//The error is "Assignment to constant variable." Constant value could not be alternated.
9-
//if line 3 const changed to let the code could be executed.
8+
//The error is "Assignment to constant variable." Constant value could not be alternated.
9+
//if line 3 const changed to let the code could be executed.

‎Sprint-2/2-mandatory-errors/2.js‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44
const cityOfBirth = "Bolton";
55
console.log(`I was born in ${cityOfBirth}`);
66

7-
8-
//Initiation should access before the declaration.
7+
//Initiation should access before the declaration.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const cardNumber = 4533787178994213;
22
const last4Digits = cardNumber.toString().slice(-4);
33

4-
console.log(last4Digits)
4+
console.log(last4Digits);
55

66
// The last4Digits variable should store the last 4 digits of cardNumber
77
// However, the code isn't working
88
// Before running the code, make and explain a prediction about why the code won't work
99
// Then run the code and see what error it gives.
1010
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
1111
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
12-
12+
1313
//slice is for text or array only. Need to change card number from number to text. use toString() to convert cardNumber
14-
//from integer to string.
14+
//from integer to string.

‎Sprint-2/2-mandatory-errors/4.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ const twelveClockTime = "8:53pm";
22
const twentyFourHourClockTime = "20:53";
33

44
//integer and number could not start for the initiation.
5-
//SyntaxError: Invalid or unexpected token - print before modified the initiation.
5+
//SyntaxError: Invalid or unexpected token - print before modified the initiation.

‎Sprint-2/3-mandatory-interpret/2-time-format.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ console.log(result);
2323
// divided 60. And the remainingSecond is 24.
2424

2525
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
26-
//A: totalMinutes get the result form movieLength (8784) minus remainingSecond (24). The result is 8760.
26+
//A: totalMinutes get the result form movieLength (8784) minus remainingSecond (24). The result is 8760.
2727
//The totalMinutes is 8760 divide 60 = 146.
2828

2929
// e) What do you think the variable result represents? Can you think of a better name for this variable?

0 commit comments

Comments
 (0)