London9-Lovelace-Mohamed Abdi-JavaScript-Core-1-Coursework-Week3 - #177
London9-Lovelace-Mohamed Abdi-JavaScript-Core-1-Coursework-Week3#177MohamedAbdi114 wants to merge 1 commit into
Conversation
JDysiewicz
left a comment
There was a problem hiding this comment.
Looks good @MohamedAbdi114 , I've left a couple comments about future uses, but this is looking good :)
| function getTemperatureReport(cities) { | ||
| // TODO | ||
| let tempArray = []; | ||
| for (let i = 0; i < cities.length; i++) { |
There was a problem hiding this comment.
How could you rewrite this without a for loop? (Hint: .map() array method)
| for (let i = 0; i < allArticleTitles.length; i++) { | ||
| average += allArticleTitles[i].length; | ||
| } | ||
| return parseInt(average / allArticleTitles.length); |
There was a problem hiding this comment.
What happens here is allARticleTitltes is an empty array?
| let priceChangeBrand = stockPriceBrand[4] - stockPriceBrand[0]; | ||
| let FormattedPriceChangeBrand = parseFloat(priceChangeBrand.toFixed(2)); |
There was a problem hiding this comment.
try to use const where possible - also in general functions and variables should be lowerCamelCase, UpperCaselCase (also called PascalCase) is reserved for classes and types
| if (input === 0 || input === 1) { | ||
| return 1; | ||
| } else { | ||
| for (let i = input - 1; i >= 1; i--) { |
There was a problem hiding this comment.
looks good, how could you rewrite this without a for loop? (https://www.freecodecamp.org/news/how-to-factorialize-a-number-in-javascript-9263c89a4b38/)
@JDysiewicz