mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-19 21:09:51 +08:00
fix(curriculum): remove unnecessary optional chaining (#53467)
This commit is contained in:
parent
293e2437f7
commit
4646c2a1cb
@ -7,7 +7,7 @@ dashedName: step-76
|
||||
|
||||
# --description--
|
||||
|
||||
If there is a match then set `userData?.currentSong` to `null` and `userData?.songCurrentTime` to `0`.
|
||||
If there is a match then set `userData.currentSong` to `null` and `userData.songCurrentTime` to `0`.
|
||||
|
||||
After that, call the `pauseSong()` function to stop the playback and the `setPlayerDisplay()` function to update the player display.
|
||||
|
||||
@ -19,13 +19,13 @@ You should not modify the existing `if` statement and its content.
|
||||
assert.match(code, /if\s*\(userData\?\.currentSong\?\.id\s*===\s*id\)\s*\{\s*.*\s*.*\s*.*\s*.*\s*\}/)
|
||||
```
|
||||
|
||||
You should set `userData?.currentSong` to `null`.
|
||||
You should set `userData.currentSong` to `null`.
|
||||
|
||||
```js
|
||||
assert.match(code, /if\s*\(userData\?\.currentSong\?\.id\s*===\s*id\)\s*\{\s*userData\.currentSong\s*=\s*null;?\s*.*\s*.*\s*.*\s*\}/)
|
||||
```
|
||||
|
||||
You should set `userData?.songCurrentTime` to `0`.
|
||||
You should set `userData.songCurrentTime` to `0`.
|
||||
|
||||
```js
|
||||
assert.match(code, /if\s*\(userData\?\.currentSong\?\.id\s*===\s*id\)\s*\{\s*userData\.currentSong\s*=\s*null;?\s*userData\.songCurrentTime\s*=\s*0;?\s*.*\s*.*\s*\}/)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user