question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manipulating Complex Objects - question

See original GitHub issue

Challenge Manipulating Complex Objects has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


var myMusic = [
  {
    "artist": "Billy Joel",
    "title": "Piano Man",
    "release_year": 1973,
    "formats": [ 
      "CS", 
      "8T", 
      "LP" ],
    "gold": true
  }
  // Add record here
];

  {
    "artist": "Daft Punk",
    "title": "Homework",
    "release_year": 1997,
    "formats": [ 
      "CD", 
      "Cassette", 
      "LP" ],
    "gold": true
  }
];

Hello everyone, I been trying to pass this section for about two days, and I asked for help on github but no one responds. I been manipulating the code multiple times, and I even used the same example in the instructions but no luck passing the section if you could please explain in detail what I did wrong or what is wrong with the code thank yo in advance.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
no-stack-dub-sackcommented, Jan 29, 2017

@RomingArt, if you copied @HasanFaraaz’s solution exactly, the code will not pass because there is an issue with his comment. That code is technically incorrect, while his solution is ok. As far as I can see, there is still not a bug with this challenge. Did my explanation not help any? Read the explanation so you understand what the issue is and remove everything from the editor and paste this in:

var myMusic = [
  {
    "artist": "Billy Joel",
    "title": "Piano Man",
    "release_year": 1973,
    "formats": [ 
      "CS", 
      "8T", 
      "LP" ],
    "gold": true
  }, // <-- comma needed here, also, you pasted the object in the wrong place
  {
    "artist":"Billy Joel",
    "title": "Piano Man",
    "release_year": 1973,
    "formats": [ "CS", "8T", 
      "LP" ],
    "gold": true
  }
];
0reactions
sintimmisacommented, May 25, 2018

try this

var myMusic = [ { “artist”: “Billy Joel”, “title”: “Piano Man”, “release_year”: 1973, “formats”: [ “CS”, “8T”, “LP” ], “gold”: true }, //note the comer here // the code below adds another album to the obj

{
“artist”: “Paco de Lucia”, “title”: “Live in America”, “release_year”: 1992, “formats” : [ “CS”, “8T”, “LP” ]

         } 

];

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manipulating Complex Objects - The freeCodeCamp Forum
Is there a question here? I'll assume that you're confused about what to do. If you have an array of objects:
Read more >
Manipulating Complex Objects [closed] - Stack Overflow
The problem is with this part: "formats": [ "formats": [ "CS", "8T", "LP" ] ]. Since the outer "formats" is an array, it...
Read more >
CodeChallenge/Manipulating Complex Objects.md at master
This is an array of objects and the object has various pieces of metadata about an album. It also has a nested formats...
Read more >
Manipulating Complex Objects (Basic JavaScript ... - YouTube
Certification: JavaScript Algorithms and Data StructuresCourse: Basic JavaScriptLesson: Manipulating Complex ObjectsfreeCodeCamp tutorialIn ...
Read more >
Introduction to Complex Objects and Composition
It lowers the overall complexity of the complex object because the main, task of the complex object would then be to delegate tasks...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found