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

London_9_Lovelace_Meysam_Arshadi_JS_Week_3 - #196

Open
Meysam-Arshadi wants to merge 4 commits into
CodeYourFuture:mainfrom
Meysam-Arshadi:main
Open

London_9_Lovelace_Meysam_Arshadi_JS_Week_3#196
Meysam-Arshadi wants to merge 4 commits into
CodeYourFuture:mainfrom
Meysam-Arshadi:main

Conversation

@Meysam-Arshadi

Copy link
Copy Markdown

No description provided.

}
return title
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi @Meysam-Arshadi
I fixed solution for titleWithFewestWords(allArticleTitles)

function titleWithFewestWords(allArticleTitles) {
// TODO
let fewestWordsSoFar
let titleWithFewestWords =''

for (let title of allArticleTitles) {
let numOfWords = title.split('').length
if (fewestWordsSoFar == undefined || numOfWords <= fewestWordsSoFar ) {
fewestWordsSoFar = numOfWords
titleWithFewestWords = title
}
}
return titleWithFewestWords
}

You can find all solutions here https://github.com/CodeYourFuture/JavaScript-Core-1-Coursework-Week3-Solution/blob/main/2-mandatory/3-financial-times.js

num = num + 2;
n--;
}
console.log(arr);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚀

// TODO - Write for loop code here
const AGES = [59, 40, 41, 63, 49];

for (let i = 0; i < WRITERS.length; i++) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice! You can also use map when there is a transformation of an array into another array of the same size.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants