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

Update description and tests for step 34 of music player #53701

Closed
jdwilkin4 opened this issue Feb 14, 2024 · 2 comments · Fixed by #53800
Closed

Update description and tests for step 34 of music player #53701

jdwilkin4 opened this issue Feb 14, 2024 · 2 comments · Fixed by #53800
Labels
help wanted Open for all. You do not need permission to work on these. new javascript course These are for issues dealing with the new JS curriculum scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.

Comments

@jdwilkin4
Copy link
Contributor

Describe the Issue

The step asks campers to check if userData?.currentSong is null.
But I don't see why we need to just check for null here.

This should also be an acceptable answer

if (!userData?.currentSong) {
    playSong(userData?.songs[0].id);
}

I don't see the need to only check for null.
We should just check if userData?.currentSong is falsey. That will allow for multiple correct answers instead of one.

Update the description and tests here to allow for multiple valid conditions instead of just one.

Affected Page

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-string-and-array-methods-by-building-a-music-player/step-34

Your code

see explanation above

Expected behavior

see explanation above

Screenshots

No response

System

  • Device: [e.g. iPhone 6, Laptop]
  • OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
  • Browser: [e.g. Chrome, Safari]
  • Version: [e.g. 22]

Additional context

No response

@jdwilkin4 jdwilkin4 added type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc. help wanted Open for all. You do not need permission to work on these. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. new javascript course These are for issues dealing with the new JS curriculum labels Feb 14, 2024
oebelus added a commit to oebelus/freeCodeCamp that referenced this issue Feb 15, 2024
oebelus added a commit to oebelus/freeCodeCamp that referenced this issue Feb 15, 2024
@gikf
Copy link
Member

gikf commented Feb 19, 2024

Uhm, is changing seed code for further steps required? It's not mentioned, but changing description to falsey kind of implies that.

@jdwilkin4
Copy link
Contributor Author

The goal of this issue is to allow for multiple correct answers instead of just userData?.currentSong === null
So it is fine if the rest of the steps use the userData?.currentSong === null in the seed code as long as campers are allowed to have answers like this

if (!userData?.currentSong) {
    playSong(userData?.songs[0].id);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. new javascript course These are for issues dealing with the new JS curriculum scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.
Projects
None yet
2 participants