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

Previous Problem, Hide and Show Practice Problem Answer #56

Merged
merged 2 commits into from
Feb 15, 2025
Merged

Conversation

Pfefferpotthast
Copy link
Collaborator

No description provided.

const toggleResultButton = document.getElementById('toggleResultButton');

if (problemEntriesDiv && correctResultDiv) {
problemEntriesDiv.innerHTML = `${problemEntries.map((entry: any) => `(${entry})`).join(' + ')}`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be done using a component rather than constructing innerHTML. You can create a new component (perhaps PreviousProblemDisplay) that accepts an array as a property and has the content of

<div>
  {entries.flatMap(e => [' + ', e]).slice(1)}
</div>

@ATOMiNATiON ATOMiNATiON merged commit 6873d8d into main Feb 15, 2025
2 checks passed
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