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

ZA2-Harerimana-Dieudonne/JavaScript-Core-1Coursework-Week3 - #74

Open
diegoharera wants to merge 1 commit into
CodeYourFuture:mainfrom
diegoharera:main
Open

ZA2-Harerimana-Dieudonne/JavaScript-Core-1Coursework-Week3#74
diegoharera wants to merge 1 commit into
CodeYourFuture:mainfrom
diegoharera:main

Conversation

@diegoharera

Copy link
Copy Markdown

No description provided.

@lexyking lexyking 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.

Great job overall. Please have a look at the comments left

let arr = [1,2,3];
console.log(arr[3]);
// console.log(arr[2])
//On the console have selected a number in the array which doesn't exit. javascript counts starting from 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Brilliant.

console.log(x);
} else {
// console.log("nothing");
}

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 try, but it doesn't cover all the use cases.
Hint: if you create an array where you stock all the first n even values, using the length of that value as a stopping condition for your while loop, it will be easier to display then

capture += index;
console.log(index);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not quite right. Please have a second look.

Hint: Try to use a return value in the function

let sum = message + capture[i];
console.log(sum);
i * 2;
} while (i < n);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not quite right. Please review the stopping condition and also the type of the variable capture

// i++;
// }
for (let i = 0; i < 29; i++) {
console.log(String.fromCharCode(94 + 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.

Great job

do {
i += generateRandomNumber();
} while (i < 50);
return 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.

Great job here

// TODO
const total = 0;
for (let title of allArticleTitles) {
total += title.length;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

total was declared as a const so it's value can't be modified

if (
allArticleTitles[i].split(" ").length < outputOfArticle.split(" ").length
)
outputOfArticle = allArticleTitles[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.

outputOfArticle was declared as const so its value can't be modified

}
let average = total / allArticleTitles.length;
return Math.round(average);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

if you update the const sus-mentioned into let the program should be just fine. Great job

Comment thread 2-mandatory/4-stocks.js
return closingPricesForAllStocks.map((priceArr) => {
return Number((priceArr[priceArr.length - 1] - priceArr[0]).toFixed(2));
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Great job on these two functions.
There is one more left highestPriceDescriptions, please give it another try.

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.

2 participants