Skip to content

Asem A - #17

Open
asemasda wants to merge 2 commits into
HackYourAssignment:mainfrom
asemasda:main
Open

asemasda wants to merge 2 commits into
HackYourAssignment:mainfrom
asemasda:main

Conversation

@asemasda

Copy link
Copy Markdown

No description provided.

@sarlam sarlam 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 on this week, I made few comments here and there with one challenge around the leap year but you do not have to do them if do not wish to

Comment thread task-1/leap-year.js Outdated
const convertYear = Number(year);


if(convertYear < 1 || convertYear > 9999){

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 is okay but if we truly want to be sure, we also should check whether convertYear is actually a number, something along the line of Number.isInteger

Comment thread task-1/leap-year.js
else{
console.log(`The year ${convertYear } Iis not a leap year because it is not divisible by 4`);

}

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 all works really well

I would like to challenge you, this is optional.

If we drop the reason why it is or is not a leap year from the console.log we could try something else and try to make it fit here:

if (convertYear < 1 || convertYear > 9999) { // Condition 1
  console.log("Invalid year!");
} else if (/* make your code here to compute the leap year in one go */) { // Condition 2
  console.log("Yes " + yearInput + " is a leap year.");
} else {
  console.log("Yes " + yearInput + " is a leap year.");
}

The challenge would be for you to fill in the condition in the else if

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.

Took the challenge, updated with a single condition.

Comment thread task-2/login.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

perfect 👍

Comment thread task-3/converter.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perfect here as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants