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

fix(curriculum): grammar issues and updated test in step 29 of music player project #53913

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ dashedName: step-32

# --description--

Before playing the song, you need to make sure it starts from the beginning. This can be achieved by the use of the `currentTime` property of the `audio` object.
Before playing the song, you need to make sure it starts from the beginning. This can be achieved by the use of the `currentTime` property on the `audio` object.

Add an `if` statement to check whether the `userData?.currentSong` is `null` or if `userData?.currentSong.id` is strictly not equal `song.id`. Inside `if` block, set the `currentTime` property of the `audio` object to `0`.
Add an `if` statement to check whether the `userData?.currentSong` is falsy *OR* if `userData?.currentSong.id` is strictly not equal to `song.id`. This condition will check if no current song is playing or if the current song is different from the one that is about to be played.

Inside your `if` block, set the `audio.currentTime` property to `0`.


# --hints--

You should create an `if` statement with the condition `userData?.currentSong === null || userData?.currentSong.id !== song.id`.
You should create an `if` statement checking `userData?.currentSong` is either `null` or `undefined`, or if its `id` is not equal to `song.id`.

```js
assert.match(code, /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\|\|\s*userData\?\.currentSong\.id\s*!==\s*song\.id\s*\)\s*\{\s*/)
assert.match(code, /if\s*\(\s*(?:(?:userData\?\.currentSong\s*===\s*(?:null|undefined)|!userData\?\.currentSong)\s*\|\|\s*userData\?\.currentSong\.id\s*!==\s*song\.id|userData\?\.currentSong\.id\s*!==\s*song\.id\s*\|\|\s*(?:userData\?\.currentSong\s*===\s*(?:null|undefined)|!userData\?\.currentSong))\s*\)\s*\{/);
```

You should set `audio.currentTime` to `0` inside your `if` block.
Expand Down
Loading