London class-10- Junita Lama -Java script core 1- week 3 - #236
London class-10- Junita Lama -Java script core 1- week 3#236Junitalama wants to merge 4 commits into
Conversation
| let fewestNumberOfWords; | ||
| for(let title of allArticleTitles){ | ||
| let numberOfWords = title.split(' ').length; | ||
| if (fewestNumberOfWords === undefined || numberOfWords < fewestNumberOfWords){ |
There was a problem hiding this comment.
good job! you have used || in if function but I have used greater > in if function.
| @@ -5,7 +5,13 @@ | |||
| Implement the function below, which will return a new array containing only article titles which will fit. | |||
| */ | |||
There was a problem hiding this comment.
Looks perfect!
One small point - just keep an eye on indentation (spacing). This will make it easier for other developers to read your code.
| @@ -12,7 +12,11 @@ | |||
| */ | |||
|
|
|||
| The editor of the FT has realised that headlines which have numbers in them get more clicks! | ||
| Implement the function below to return a new array containing all the headlines which contain a number. | ||
| (Hint: remember that you can also loop through the characters of a string if you need to) | ||
| */ |
There was a problem hiding this comment.
This looks good 👍
I like that you used a separate function to check if the string contains a number - it makes the code more readable 😄
One small point: when you have code like this - if (containsNumbers(title)== true) {, you can also write it like this if (containsNumbers(title)) {. Can you think of why that is?
|
Great work on this coursework 👍 |
@moneyinthesky Thank you so much for reviewing it and giving feedback. |
No description provided.