WM4 - Azin Yadegari - JavaScript -Core-1-Week3 - #102
Conversation
WM4- Azin Yadegari -JavaScript-Core-1-Week 3
Dawit-Dev
left a comment
There was a problem hiding this comment.
Nice job. Your codes are very clean and simple to comprehend. maintain your good work
Fibonacci Sequence
| let i=0 | ||
| let sum=0 | ||
| do { | ||
| sum+=(i*2) |
| function getTemperatureReport(cities) { | ||
| // TODO | ||
| let tempRepo=[] | ||
| for (i=0 ; i < cities.length ; i++){ |
There was a problem hiding this comment.
I also often forget to declare variable -i in loops))
| // TODO | ||
| let titleWithNum=[] | ||
| for (const title of allArticleTitles){ | ||
| if (/\d/.test(title)){ |
There was a problem hiding this comment.
test() - interesting method, I'll keep it in mind
| function getTemperatureReport(cities) { | ||
| // TODO | ||
| let tempRepo=[] | ||
| for (i=0 ; i < cities.length ; i++){ |
There was a problem hiding this comment.
What's missing from this line of code?
| // TODO | ||
| let acceptedTitles=[] | ||
| let lengthCheck=0 | ||
| for ( i=0 ; i < allArticleTitles.length ; i++){ |
There was a problem hiding this comment.
What's missing from this line of code?
| let wordCountOFTitles=[] | ||
| let i=0 | ||
| do { | ||
| let wordCount= allArticleTitles[i].trim().split(" ").length |
There was a problem hiding this comment.
Nice job calling .trim() 👍 why did you do that?
There was a problem hiding this comment.
thanks,to remove any blank space from both end , & prevent counting extra word :)
| } | ||
| while(i < allArticleTitles.length) | ||
|
|
||
| minValue= Math.min(...wordCountOFTitles) |
| let sum=0 | ||
| let average=0 | ||
| let j=0 | ||
| do{ |
There was a problem hiding this comment.
Why did you chose a do while loop for this?
| let priceChangeArray=[] | ||
| for(i=0 ; i< closingPricesForAllStocks.length ; i++){ | ||
| let priceChange=0 | ||
| priceChange =parseFloat((closingPricesForAllStocks[i][(closingPricesForAllStocks[i].length -1)]-closingPricesForAllStocks[i][0]).toFixed(2)) |
There was a problem hiding this comment.
Can you think of a way to make this line of code more clear?
jdbevan
left a comment
There was a problem hiding this comment.
Good effort, don't forget to format your code before creating a PR
No description provided.