Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

London-Class-8-JavaScript-Core-1-Coursework-Week3-Timea-Reich - #35

Open
TimeaReich wants to merge 5 commits into
CodeYourFuture:mainfrom
TimeaReich:main
Open

London-Class-8-JavaScript-Core-1-Coursework-Week3-Timea-Reich#35
TimeaReich wants to merge 5 commits into
CodeYourFuture:mainfrom
TimeaReich:main

Conversation

@TimeaReich

Copy link
Copy Markdown

No description provided.

firstJulyBirthday = birthdays[i];
}
return firstJulyBirthday
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice use for for loop here

}
return newArr
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of regex here

Comment thread 2-mandatory/4-stocks.js
@@ -33,7 +41,7 @@ function getAveragePrices(closingPricesForAllStocks) {
for (let j=0; j<closingPricesForAllStocks[i].length; j++){

@teniolao teniolao Jan 21, 2022

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good variable names and readable code. great work Timea.

// TODO
let firstJulyBirthday= '';
for (let i=0; i<birthdays.length; i++){
if (birthdays[i] === 'July 11th')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This checks for the 11th of July only, is there a way we could use includes method on arrays to check for any day in July?

Here's the docs for includes https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes

"Tottenham Court Road"
];

for (let i=0; i<tubeStations.length; i++){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line 14 and 21 are for loops but not for-of loops as they do not contain the keyword "of". Could you replace these for loops with for-of loops. Examples of for-of loops can be found on MDN https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of

do {
number = generateRandomNumber();
}
while (number < 50)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this function, we want to return when the number is greater than 50 only. Is it possible for 50 to be returned and if so, could you change this line to only return greater than 50 and not 50?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants