Glasgow_6 - HERISH TURKI - JS -Core-1-Coursework-Week3 - #242
Conversation
Mandatory section is completed .
| const temperature = temperatureService(city); | ||
| const statement = `The temperature in ${city} is ${temperature} degrees`; | ||
| temperatureStatementArray.push(statement); | ||
| } |
There was a problem hiding this comment.
I learned a lotfrom that Udemy tutorial, he always uses template literal, you have watched it too
| // TODO | ||
| // TODO | ||
| const headlines = allArticleTitles.filter((title) => title.length <= 65); | ||
|
|
|
|
||
| for (const eachTitle of allArticleTitles) { | ||
| for (const char of eachTitle) { | ||
| if (!isNaN(parseInt(char))) { |
There was a problem hiding this comment.
that's intrusting use of the Boolean values i learned something here thank you.
There was a problem hiding this comment.
Hi Nasir :) I like this too, took me half a day to find this and sink in, especially this 3 devils :))) ===> ! is NaN
this feels like a maze inside another maze
shieldo
left a comment
There was a problem hiding this comment.
This is really good work! I've made a couple of comments about variable naming, but that's very minor. All your tests pass and everything you have done here is reasonable. I'd encourage you to try looking at array methods like .map() and .filter() that can help simplify the code here in some cases.
| // TODO | ||
| // TODO | ||
|
|
||
| const average_CLOSING_PRICES_LAST_5_DAYS_FOR_ALL_STOCKS = []; |
There was a problem hiding this comment.
It's better to use variable names that are just short enough here - and remember that this function doesn't know that the closing prices are from the last 5 days - they could be from the last 10 days and the function should still work! closingPriceAverages or averageClosingPrices could be a good name for the variable here.
There was a problem hiding this comment.
Thanks a lot, I will try to use those methods as many times as possible for the week4.
| function highestPriceDescriptions(closingPricesForAllStocks, stocks) { | ||
| // TODO | ||
| // TODO | ||
| const eachArrayHighestPricDdescriptions = []; |
There was a problem hiding this comment.
highestPriceDescriptions might be a clearer name here.
Mandatory section is completed .