-
-
Notifications
You must be signed in to change notification settings - Fork 282
London-10/Mahendra-Balal/JavaScript-core-1/Coursework/Week-3 #265
base: main
Are you sure you want to change the base?
London-10/Mahendra-Balal/JavaScript-core-1/Coursework/Week-3 #265
Conversation
| - Hint: you can call the temperatureService function from your function | ||
| */ | ||
|
|
||
| function getTemperatureReport(cities) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks perfect! Good job 😄
| The home page of the web site has a headline section, which only has space for article titles which are 65 characters or less. | ||
| Implement the function below, which will return a new array containing only article titles which will fit. | ||
| */ | ||
| function potentialHeadlines(allArticleTitles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation here looks good 👍
I would suggest giving the ARTICLE_TITLES a different name. It may be confusing because there's another variable with the same name on this page.
Can you think of a different name for it?
| (you can assume words will always be seperated by a space) | ||
| (you can assume words will always be separated by a space) | ||
| */ | ||
| function titleWithFewestWords(allArticleTitles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good attempt. I think there is one small problem with this code.
We want to look for the article with the fewest words. Have a think about what .split("") does in your code.
| return /[0-9]/.test(str); | ||
| } | ||
|
|
||
| /* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 👍
I like how you used another function to help you solve the problem 😄
|
This was a good effort @mabalal |
No description provided.