Bugged test: Basic JavaScript - Record Collection

One of the tests is allowing the following condition to pass when it shouldn’t:

if(prop == ‘tracks’ && records[id].hasOwnProperty(‘tracks’) == false){
records[id].tracks = [value];
records[id].tracks.pop();
}

It’s supposed to pass when it has the element and not when it’s empty.

Challenge: {{challengeTitle}} Basic JavaScript - Record Collection

Link to the challenge:

Please paste your entire solution in here and wrap it with spoiler tags. The spoiler tags must be on a line of their own.

[spoiler]

Your code here following the instructions below

[/spoiler]

To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.

Mod Edit: SOLUTION REMOVED

ah I get it. I wasn’t using the else keywords

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.