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

BEKIR-London-10-JS-Week3-Mandatory+Extra - #234

Open
BekirKuscu wants to merge 17 commits into
CodeYourFuture:mainfrom
BekirKuscu:main
Open

BEKIR-London-10-JS-Week3-Mandatory+Extra#234
BekirKuscu wants to merge 17 commits into
CodeYourFuture:mainfrom
BekirKuscu:main

Conversation

@BekirKuscu

Copy link
Copy Markdown

No description provided.

@BekirKuscu BekirKuscu changed the title BEKIR-London-JS-Week3-Mandatory+Extra BEKIR-London 10-JS-Week3-Mandatory+Extra Mar 5, 2023
@BekirKuscu BekirKuscu changed the title BEKIR-London 10-JS-Week3-Mandatory+Extra BEKIR-London-10-JS-Week3-Mandatory+Extra Mar 5, 2023
@BekirKuscu BekirKuscu changed the title BEKIR-London-10-JS-Week3-Mandatory+Extra BEKIR-London(10)-JS-Week3-Mandatory+Extra Mar 5, 2023
@BekirKuscu BekirKuscu changed the title BEKIR-London(10)-JS-Week3-Mandatory+Extra BEKIR-London-10-JS-Week3-Mandatory+Extra Mar 5, 2023
@@ -12,7 +12,14 @@
*/

function getTemperatureReport(cities) {

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 👍

@@ -5,16 +5,33 @@
Implement the function below, which will return a new array containing only article titles which will fit.
*/
function potentialHeadlines(allArticleTitles) {

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 is a good solution!
For extra practice, you could try re-writing this with the filter array method.

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.

Trying other methods and ways of solving code is something I'm going to be aiming for. Thank you.

Implement the function below, which returns the title with the fewest words.
(you can assume words will always be seperated by a space)
*/
function titleWithFewestWords(allArticleTitles) {

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.

Your solution will give you the title with the fewest characters, but this might not be the fewest words.
Can you fix this by making a couple of small changes?

The Financial Times wants to understand what the average number of characters in an article title is.
Implement the function below to return this number - rounded to the nearest integer.
*/
function averageNumberOfCharacters(allArticleTitles) {

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! Good job 😄

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!

Comment thread 2-mandatory/3-stocks.js
@@ -34,9 +35,26 @@ const CLOSING_PRICES_LAST_5_DAYS_FOR_ALL_STOCKS = [
Functions can help with this!
*/
function getAveragePrices(closingPricesForAllStocks) {

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.

Good solution, and nicely explained 👍

Comment thread 2-mandatory/3-stocks.js

for (let i = 0; i < stocks.length; i++) {
const ticker = stocks[i].toUpperCase();
const highestPrice = Math.max(...closingPricesForAllStocks[i]).toFixed(2);

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 use of Math.max

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.

It's nice finding things and trying things I'm unfamiliar with on Google.


function isRadioStation(frequency) {
return getAvailableStations().includes(frequency);
function getStations() {

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.

Great work 😄
A small note, but arrow functions can be simplified even further. In this case, we can write the following:

const radioStations = allFrequencies.filter(frequency => isRadioStation(frequency));

@moneyinthesky

Copy link
Copy Markdown
Contributor

Overall, great job on this coursework 😄

@moneyinthesky moneyinthesky added the reviewed A mentor has reviewed this code label Mar 14, 2023
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.

2 participants