Skip to content

Commit 1c2d412

Browse files
authored
Merge branch 'CodeYourFuture:main' into practice-tdd
2 parents 6e28c70 + 1ae8808 commit 1c2d412

7 files changed

Lines changed: 15 additions & 20 deletions

File tree

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
let firstName = "Creola";
2-
let middleName = "Katherine";
3-
let lastName = "Johnson";
1+
const firstName = "Creola";
2+
const middleName = "Katherine";
3+
const lastName = "Johnson";
44

55
// Declare a variable called initials that stores the first character of each string.
66
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.
77

8-
let initials = ``;
8+
const initials = ``;
99

1010
// https://www.google.com/search?q=get+first+character+of+string+mdn
11-

Sprint-1/4-stretch-explore/chrome.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
Open a new window in Chrome,
2-
3-
then locate the **Console** tab.
1+
Open a new window in Chrome, right click an empty space on the page, select **Inspect** from the dropdown, then locate the **Console** tab.
42

53
Voila! You now have access to the [Chrome V8 Engine](https://www.cloudflare.com/en-gb/learning/serverless/glossary/what-is-chrome-v8/).
64
Just like the Node REPL, you can input JavaScript code into the Console tab and the V8 engine will execute it.
75

86
Let's try an example.
97

10-
In the Chrome console,
11-
invoke the function `alert` with an input string of `"Hello world!"`;
8+
In the Chrome console, invoke the function `alert` with one argument, the string `"Hello world!"`;
129

1310
What effect does calling the `alert` function have?
1411

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
// squaring your height: 1.73 x 1.73 = 2.99
88
// dividing 70 by 2.99 = 23.41
9-
// Your result will be displayed to 1 decimal place, for example 23.4.
9+
// Your result will be displayed to 1 decimal place, for example '23.4'.
1010

1111
// You will need to implement a function that calculates the BMI of someone based off their weight and height
1212

1313
// Given someone's weight in kg and height in metres
1414
// Then when we call this function with the weight and height
15-
// It should return their Body Mass Index to 1 decimal place
15+
// It should return a string of their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18-
// return the BMI of someone based off their weight and height
19-
}
18+
// return the BMI of someone based off their weight and height
19+
}

Sprint-2/3-mandatory-implement/3-to-pounds.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// In Sprint-1, there is a program written in interpret/to-pounds.js
1+
// In Sprint-1, there is a program written in 3-mandatory-interpret/3-to-pounds.js
22

33
// You will need to take this code and turn it into a reusable block of code.
44
// You will need to declare a function called toPounds with an appropriately named parameter.

Sprint-2/4-mandatory-interpret/time-format.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function formatTimeDisplay(seconds) {
2828
// b) What is the value assigned to num when pad is called for the first time?
2929
// =============> write your answer here
3030

31-
// c) What is the return value of pad is called for the first time?
31+
// c) What is the return value of pad when it is called for the first time?
3232
// =============> write your answer here
3333

3434
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer

Sprint-3/4-stretch/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ These stretch activities are not mandatory, but we hope you will explore them af
44

55
In this exercise, you'll need to **play computer** with the function `find`. This function makes use of while loop statement. Your task will be to step through the code to figure out what is happening when the computer executes the code.
66

7-
Next, try implementing the functions specified in `password-validator.js`.
7+
Next, try implementing the function in `password-validator.js` (description of its expected behaviour is in the accompanying `password-validator.test.js` file).
88

99
Finally, set up your own script and test files for `card-validator.md`
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
function passwordValidator(password) {
2-
return password.length < 5 ? false : true
2+
return password.length >= 5;
33
}
44

5-
6-
module.exports = passwordValidator;
5+
module.exports = passwordValidator;

0 commit comments

Comments
 (0)