WM4 - class 1 - Simeon Bikov - JS - week 3 - #108
Conversation
|
|
||
| function getTemperatureReport(cities) { | ||
| // TODO | ||
| res = []; |
There was a problem hiding this comment.
Do you think you're missing anything on this line?
| */ | ||
| function potentialHeadlines(allArticleTitles) { | ||
| // TODO | ||
| let shortArticles = allArticleTitles.filter(title => title.length < 66); |
| // TODO | ||
| let arrOfLength = []; | ||
| for (let i = 0; i < allArticleTitles.length; i++) { | ||
| arrOfLength.push(allArticleTitles[i].split(" ").length - 1); |
There was a problem hiding this comment.
Why did you use .push() here instead of arrOfLength[i]?
Naming variables is hard. What data is being stored in the arrOfLength variable? Can you think of a better name?
| */ | ||
| function headlinesWithNumbers(allArticleTitles) { | ||
| // TODO | ||
| articlesWithNumbers = []; |
There was a problem hiding this comment.
What is missing from this line of code? Why does it still work without the missing piece of code?
| */ | ||
| function averageNumberOfCharacters(allArticleTitles) { | ||
| // TODO | ||
| let sum = 0; |
There was a problem hiding this comment.
Naming is hard. What is this the sum of? Can you think of a better variable name?
| function getPriceChanges(closingPricesForAllStocks) { | ||
| // TODO | ||
| let changeInPrice = []; | ||
| let firstPrice = 0; |
There was a problem hiding this comment.
What is the benefit of defining these variables outside of the for loop?
| let highestPrice = 0; | ||
|
|
||
| for (let i = 0; i < closingPricesForAllStocks.length; i++) { | ||
| highestPrice = Math.max(...closingPricesForAllStocks[i]); |
| function highestPriceDescriptions(closingPricesForAllStocks, stocks) { | ||
| // TODO | ||
| let highestPriceForAllStock = []; | ||
| let highestPrice = 0; |
There was a problem hiding this comment.
What's the benefit of defining this variable outside of the for loop?
jdbevan
left a comment
There was a problem hiding this comment.
Nice work Simeon! You've solved some hard problems here :)
No description provided.