From c4f7549711445fd39aca4454ebe86a3e05716847 Mon Sep 17 00:00:00 2001 From: Mikey Esteban Date: Wed, 21 Feb 2024 02:45:42 -0500 Subject: [PATCH] fix(curriculum) updated text and added new conditions to tests (#53800) --- .../65422ba173a18b1bedef1bb6.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/65422ba173a18b1bedef1bb6.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/65422ba173a18b1bedef1bb6.md index ff96ed160c2..8a929149ac2 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/65422ba173a18b1bedef1bb6.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/65422ba173a18b1bedef1bb6.md @@ -7,22 +7,22 @@ dashedName: step-34 # --description-- -Within the arrow function of the event listener, add an `if` to check if `userData?.currentSong` is `null`. +Within the arrow function of the event listener, add an `if` to check if `userData?.currentSong` is `falsey`. Inside the `if` block, call the `playSong()` function with the `id` of the first song in the `userData?.songs` array. This will ensure the first song in the playlist is played first. # --hints-- -You should create an `if` statement with the condition `userData?.currentSong === null`. +You should create an `if` statement with the condition `!userData?.currentSong`. ```js -assert.match(code, /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{/) +assert.match(code, /if\s*\((\s*\!userData\?\.currentSong\s*|\s*userData\?\.currentSong\s*===\s*null\s*|\s*userData\?\.currentSong\s*===\s*undefined\s*)\)\s*\{/) ``` You should call the `playSong` function with `userData?.songs[0].id` inside your `if` block. ```js -assert.match(code, /if\s*\(\s*userData\?\.currentSong\s*===\s*null\s*\)\s*\{\s*playSong\(\s*userData\?\.songs\s*\[\s*0\s*\]\s*\.id\s*\);?\s*\}/) +assert.match(code, /if\s*\((\s*\!userData\?\.currentSong\s*|\s*userData\?\.currentSong\s*===\s*null\s*|\s*userData\?\.currentSong\s*===\s*undefined\s*)\)\s*\{\s*playSong\(\s*userData\?\.songs\s*\[\s*0\s*\]\s*\.id\s*\);?\s*\}/) ``` # --seed--