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

London Class 8 - Irina Shilova - JavaScript-Core-1-Coursework-Week3 London 8 - #14

Open
IrinShilova wants to merge 3 commits into
CodeYourFuture:mainfrom
IrinShilova:main
Open

London Class 8 - Irina Shilova - JavaScript-Core-1-Coursework-Week3 London 8#14
IrinShilova wants to merge 3 commits into
CodeYourFuture:mainfrom
IrinShilova:main

Conversation

@IrinShilova

Copy link
Copy Markdown

No description provided.


function evenNumbers(n) {
// TODO
if (n === 0) {

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 implementation! :)
Just keep an eye on indentation, to make the code more readable.

// TODO

let i = 0;
while (birthdays[i].substring(0, 4) !== "July") {

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 works and is perfectly fine.
Another way to achieve the same thing here is using the String startsWith method: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith

*/
function potentialHeadlines(allArticleTitles) {
// TODO
let newArticle = [];

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.

The implementation here is good. A couple of minor points - indentation in the body of the if-statement would improve readability.
Also, maybe the variable name newArticle could be better, as it is an array that will hold multiple articles.

function headlinesWithNumbers(allArticleTitles) {
// TODO
let arrNum = [];
for (let i = 0; i < allArticleTitles.length; 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.

This is an interesting implementation :)
You could make this a little bit more efficient using the break keyword. Basically, in the inner loop - if you've already added the current word to the array, you can break out of the loop, and just carry on to the next word.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/break

Comment thread 2-mandatory/4-stocks.js
function getAveragePrices(closingPricesForAllStocks) {
// TODO
}
let averageArr = [];

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 implementation :)

Comment thread 2-mandatory/4-stocks.js
// TODO
let priceChange = [];
for (let i = 0; i < closingPricesForAllStocks.length; i++) {
priceChange.push(Math.round((closingPricesForAllStocks[i][closingPricesForAllStocks[i].length-1] - closingPricesForAllStocks[i][0]) * 100) / 100);

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 good, but it would be a good idea to split this into multiple lines to improve the readability of the code.

Comment thread 2-mandatory/4-stocks.js
*/
function highestPriceDescriptions(closingPricesForAllStocks, stocks) {
// TODO
let maxPrice = [];

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

Comment thread 3-extra/1-factorial.js

function factorial(input) {
// TODO
let production = 1;

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.

Very good :)

Comment thread 3-extra/3-fibonacci.js

function generateFibonacciSequence(n) {
// TODO
let fibArr = [0, 1];

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.

Also very good :)

@moneyinthesky

Copy link
Copy Markdown
Contributor

This is great work @IrinShilova. Very impressive!

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