Skip to content

NW6| Fikret Ellek | JS3- CodeAlong-NumberFacts | Week 2 - #29

Open
fikretellek wants to merge 1 commit into
CodeYourFuture:mainfrom
fikretellek:nw6/fikretellek
Open

fikretellek wants to merge 1 commit into
CodeYourFuture:mainfrom
fikretellek:nw6/fikretellek

Conversation

@fikretellek

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

Briefly explain your PR.

Questions

Ask any questions you have for your reviewer.

@pseudopilot pseudopilot 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! Just left one comment for you.

Comment thread index.html
Comment on lines +67 to +71
factCont.style.display = "block";

if (number === "") {
factCont.style.display = "none";
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like both of your implementations of getFactFetch 👍 .
A little comment regarding factCont.style.display. For such cases when we want to assign one or another value to some variable depending on some condition there is a commonly used ternary operator in JS (you can read more about it here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator)
Long story short, you can simplify this part of code the following way:

factCont.style.display = number === "" ? "none" : "block";

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