London-Class-8-JavaScript-Core-1-Coursework-Week3-Timea-Reich - #35
London-Class-8-JavaScript-Core-1-Coursework-Week3-Timea-Reich#35TimeaReich wants to merge 5 commits into
Conversation
| firstJulyBirthday = birthdays[i]; | ||
| } | ||
| return firstJulyBirthday | ||
| } |
| } | ||
| return newArr | ||
| } | ||
|
|
| @@ -33,7 +41,7 @@ function getAveragePrices(closingPricesForAllStocks) { | |||
| for (let j=0; j<closingPricesForAllStocks[i].length; j++){ | |||
There was a problem hiding this comment.
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') |
There was a problem hiding this comment.
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++){ |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
No description provided.