Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

London class-10- Junita Lama -Java script core 1- week 3 - #236

Open
Junitalama wants to merge 4 commits into
CodeYourFuture:mainfrom
Junitalama:main
Open

London class-10- Junita Lama -Java script core 1- week 3#236
Junitalama wants to merge 4 commits into
CodeYourFuture:mainfrom
Junitalama:main

Conversation

@Junitalama

Copy link
Copy Markdown

No description provided.

@SalihaPopal SalihaPopal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!!!!

let fewestNumberOfWords;
for(let title of allArticleTitles){
let numberOfWords = title.split(' ').length;
if (fewestNumberOfWords === undefined || numberOfWords < fewestNumberOfWords){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect!
One small point - just keep an eye on indentation (spacing). This will make it easier for other developers to read your code.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, i will fix it .

@@ -12,7 +12,11 @@
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 👍

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)
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@moneyinthesky

Copy link
Copy Markdown
Contributor

Great work on this coursework 👍

@moneyinthesky moneyinthesky added the reviewed A mentor has reviewed this code label Mar 18, 2023
@Junitalama

Copy link
Copy Markdown
Author

Great work on this coursework 👍

@moneyinthesky Thank you so much for reviewing it and giving feedback.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

reviewed A mentor has reviewed this code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants