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

London 9 - Marziyeh Azhdari - JS-Core-1 - Week 3 - #173

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

London 9 - Marziyeh Azhdari - JS-Core-1 - Week 3#173
MariAzhdari wants to merge 3 commits into
CodeYourFuture:mainfrom
MariAzhdari:main

Conversation

@MariAzhdari

Copy link
Copy Markdown

No description provided.

@Bahare09

Copy link
Copy Markdown

Good job .Well done Mari 🥇

arr.push(num)
num += 2
n--
}

@mcarballopacheco mcarballopacheco Dec 20, 2022

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This function works. Another way to write it which for me it's a bit more readable would be like this:

function evenNumbers(n) {
let num= 0 ;
let arr =[]
while(num < n){
arr.push(2*num)
num ++
}

I find it more natural that the comparison is between n and num but both of them are correct.

function evenNumbersSum(n) {
// TODO
let result = 0;
let i = 0 * 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.

This could be i =0

do{
result += i * 2;
i++;
}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.

Great work here Mari!


// TODO - Write for loop code here

for(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.

The comparison should be i < WRITERS.length, because array start counting from 0. With the current code, you will get an undefined for the last line.

let arr=[]
for (let article of allArticleTitles){
for (let char of article){
if (char>="0" && char<="9"){

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

cool!

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Comment thread 3-extra/1-factorial.js

function factorial(input) {
// TODO
let sum = 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Very small detail, but this is not a sum but a product. The function is correct though.

@mcarballopacheco mcarballopacheco 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 work here, Mari!

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