diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652f948489abbb81e6bf5a01.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652f948489abbb81e6bf5a01.md index 46f40bd5cd0..7c0c685b399 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652f948489abbb81e6bf5a01.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652f948489abbb81e6bf5a01.md @@ -16,16 +16,28 @@ Start by accessing the `#playlist-songs`, `#play`, and `#pause` elements with th # --hints-- +You should have a variable called `playlistSongs`. + +```js +assert.isDefined(playlistSongs); +``` + You should use `document.getElementById()` to get the `#playlist-songs` element. ```js assert.match(code, /document\.getElementById\(\s*('|"|`)playlist\-songs\1\s*\)/); ``` -You should assign the `#playlist-songs` element to the variable `playlistSongs`. Don't forget to use `const` to declare the variable. +You should assign the `#playlist-songs` element to the variable `playlistSongs`. ```js -assert.match(code, /const\s+playlistSongs\s*\=\s*document\.getElementById\(\s*('|"|`)playlist\-songs\1\s*\)/); +assert.equal(playlistSongs, document.getElementById('playlist-songs')); +``` + +You should have a variable called `playButton`. + +```js +assert.isDefined(playButton); ``` You should use `document.getElementById()` to get the `#play` element. @@ -34,10 +46,16 @@ You should use `document.getElementById()` to get the `#play` element. assert.match(code, /document\.getElementById\(\s*('|"|`)play\1\s*\)/); ``` -You should assign the `#play` element to the variable `playButton`. Don't forget to use `const` to declare the variable. +You should assign the `#play` element to the variable `playButton`. ```js -assert.match(code, /const\s+playButton\s*\=\s*document\.getElementById\(\s*('|"|`)play\1\s*\)/); +assert.equal(playButton, document.getElementById('play')); +``` + +You should have a variable called `pauseButton`. + +```js +assert.isDefined(pauseButton); ``` You should use `document.getElementById()` to get the `#pause` element. @@ -46,10 +64,10 @@ You should use `document.getElementById()` to get the `#pause` element. assert.match(code, /document\.getElementById\(\s*('|"|`)pause\1\s*\)/); ``` -You should assign the `#pause` element to the variable `pauseButton`. Don't forget to use `const` to declare the variable. +You should assign the `#pause` element to the variable `pauseButton`. ```js -assert.match(code, /const\s+pauseButton\s*\=\s*document\.getElementById\(\s*('|"|`)pause\1\s*\)/); +assert.equal(pauseButton, document.getElementById('pause')); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652fa2aee6374ad29b5d49b4.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652fa2aee6374ad29b5d49b4.md index fe49788c1da..c4deca54d7c 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652fa2aee6374ad29b5d49b4.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652fa2aee6374ad29b5d49b4.md @@ -13,16 +13,28 @@ Assign them to variables named `nextButton`, `previousButton`, and `shuffleButto # --hints-- +You should have a variable called `nextButton`. + +```js +assert.isDefined(nextButton); +``` + You should use `document.getElementById()` to get the `#next` element. ```js assert.match(code, /document\.getElementById\(\s*('|"|`)next\1\s*\)/); ``` -You should assign the `#next` element to the variable `nextButton`. Don't forget to use `const` to declare the variable. +You should assign the `#next` element to the variable `nextButton`. ```js -assert.match(code, /const\s+nextButton\s*\=\s*document\.getElementById\(\s*('|"|`)next\1\s*\)/); +assert.equal(nextButton, document.getElementById('next')); +``` + +You should have a variable called `previousButton`. + +```js +assert.isDefined(previousButton); ``` You should use `document.getElementById()` to get the `#previous` element. @@ -31,10 +43,16 @@ You should use `document.getElementById()` to get the `#previous` element. assert.match(code, /document\.getElementById\(\s*('|"|`)previous\1\s*\)/); ``` -You should assign the `#previous` element to the variable `previousButton`. Don't forget to use `const` to declare the variable. +You should assign the `#previous` element to the variable `previousButton`. ```js -assert.match(code, /const\s+previousButton\s*\=\s*document\.getElementById\(\s*('|"|`)previous\1\s*\)/); +assert.equal(previousButton, document.getElementById('previous')); +``` + +You should have a variable called `shuffleButton`. + +```js +assert.isDefined(shuffleButton); ``` You should use `document.getElementById()` to get the `#shuffle` element. @@ -43,10 +61,10 @@ You should use `document.getElementById()` to get the `#shuffle` element. assert.match(code, /document\.getElementById\(\s*('|"|`)shuffle\1\s*\)/); ``` -You should assign the `#shuffle` element to the variable `shuffleButton`. Don't forget to use `const` to declare the variable. +You should assign the `#shuffle` element to the variable `shuffleButton`. ```js -assert.match(code, /const\s+shuffleButton\s*\=\s*document\.getElementById\(\s*('|"|`)shuffle\1\s*\)/); +assert.equal(shuffleButton, document.getElementById('shuffle')); ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652fa3c4968fa9d6f8f6d873.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652fa3c4968fa9d6f8f6d873.md index a16b4acf194..2789f43dc82 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652fa3c4968fa9d6f8f6d873.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/652fa3c4968fa9d6f8f6d873.md @@ -13,10 +13,22 @@ Create an empty `allSongs` array. # --hints-- -You should use `const` to create an empty `allSongs` array. +You should have a variable called `allSongs`. ```js -assert.match(code, /const\s+allSongs\s*=\s*\[\s*\]/) +assert.isDefined(allSongs) +``` + +You should assign an array to your `allSongs` variable. + +```js +assert.isArray(allSongs) +``` + +Your array should be empty. + +```js +assert.isEmpty(allSongs) ``` # --seed-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/653281af14be5f2055310f8e.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/653281af14be5f2055310f8e.md index 6de4928f664..556812c2969 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/653281af14be5f2055310f8e.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/653281af14be5f2055310f8e.md @@ -13,12 +13,6 @@ Start by using the `let` keyword to declare a new variable called `userData` and # --hints-- -You should have a variable called `userData`. - -```js -assert.isDefined(userData); -``` - You should use the `let` keyword to create the `userData` variable. ```js diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/656071d679089ebd9d5035a0.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/656071d679089ebd9d5035a0.md index 0cddaad5356..07a14a40389 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/656071d679089ebd9d5035a0.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-string-and-array-methods-by-building-a-music-player/656071d679089ebd9d5035a0.md @@ -23,10 +23,16 @@ Inside the `userData` object create a `songs` property. For the value, spread `a # --hints-- -Your `userData` object should have a `songs` key set to `[...allSongs]`. +Your `userData` object should have a key called `songs`. ```js -assert.match(code, /songs\s*:\s*\[\s*\.\.\.allSongs\s*\]\s*,?/); +assert.property(userData, "songs"); +``` + +Your `songs` property should have a value of `[...allSongs]`. + +```js +assert.deepPropertyVal(userData, "songs", [...allSongs]); ``` # --seed--