Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #1511

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Solution #1511

wants to merge 2 commits into from

Conversation

reseneweb
Copy link

Copy link

@loralevitska loralevitska left a comment

Choose a reason for hiding this comment

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

A little more and it will be completed

Comment on lines 14 to 22
{(() => {
if (person.isMarried) {
return person.sex === 'm'
? `${person.partnerName} is my wife`
: `${person.partnerName} is my husband`;
}

return 'I am not married';
})()}

Choose a reason for hiding this comment

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

Avoid ternary nesting (even if you used if instead of one). Move this expression (person.sex === 'm'
? ${person.partnerName} is my wife
: ${person.partnerName} is my husband;) to variable, and then use interpolation

Suggested change
{(() => {
if (person.isMarried) {
return person.sex === 'm'
? `${person.partnerName} is my wife`
: `${person.partnerName} is my husband`;
}
return 'I am not married';
})()}
{person.isMarried ? yourAwesomeVariableName : 'I am not married'}

Copy link

@lerastarynets lerastarynets left a comment

Choose a reason for hiding this comment

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

You've got this, keep pushing forward!

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.

3 participants