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

LONDON-10/BAKI TUNCER/JAVASCRIPT-3 - #247

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

LONDON-10/BAKI TUNCER/JAVASCRIPT-3#247
batuncer wants to merge 4 commits into
CodeYourFuture:mainfrom
batuncer:main

Conversation

@batuncer

@batuncer batuncer commented Mar 7, 2023

Copy link
Copy Markdown

BAKI TUNCER
WEEK 3

I am struggling with data structure and algorithms

return allArticleTitles.filter(title => title.length <= 65);

}

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 Baki

Comment thread 2-mandatory/3-stocks.js
const avarageFixed=avarage.toFixed(2)

output.push(avarageFixed)
}

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 Baki
I sew you done nice work here with big effort and I want add here you can use for loop in two time instead to use two function

check here

function getAveragePrices(closingPricesForAllStocks) {
    let result = [];
    for (let i = 0; i < closingPricesForAllStocks.length; i++) {
    let total = 0;
    for (let j = 0; j < closingPricesForAllStocks[i].length; j++) {
        total += closingPricesForAllStocks[i][j];
    }
    result.push(parseFloat((total / 5).toFixed(2)));
    }
    return result;
}

this is my review for this week
Thanks Baki

@@ -13,6 +13,21 @@

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 solution 👍

@@ -6,6 +6,9 @@
*/

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!

@@ -15,6 +18,13 @@ 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.

Nice way to solve this one!
The next step is to think about different arrays that might be passed into this function (in the allArticleTitles parameter). What will your code do if allArticleTitles only has one title in the array?

@@ -32,6 +53,14 @@ function headlinesWithNumbers(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 good to me 👍

@@ -24,6 +34,17 @@ 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.

Looks like this works!
If you get time, you can experiment with different ways of checking if there's a number in a string - and then have a think about whether one approach might be better than another.

Comment thread 2-mandatory/3-stocks.js Outdated

let output=[]

for (let i=0 ; i< closingPricesForAllStocks.lenght; i++){

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.

Small typo here 😄 in "lenght"

Comment thread 2-mandatory/3-stocks.js Outdated
let output=[]

for (let i=0 ; i< closingPricesForAllStocks.lenght; i++){
const price = closingPricesForAllStocks[i];

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.

It is worth thinking about the parameter closingPricesForAllStocks. What it is the type of this variable?
From the question above we can see: "it's an array of arrays". So closingPricesForAllStocks[i] is not just one price, it's an array of all the prices for one stock.

Comment thread 3-extra/3-fibonacci.js

function generateFibonacciSequence(n) {
// TODO

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 job on this one!

@moneyinthesky

Copy link
Copy Markdown
Contributor

Nice work on this coursework @batuncer!
I can see you struggled a bit with the stocks exercises - this is normal, as those exercises are a bit tricky 😄
Good job 👍

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

3 participants