Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Displaying the Content

Jamela Peterson
Jamela Peterson
2,977 Points

My code from Fetching API video is not working. Keep getting Syntax error...

Hi... I'm following the code written by the instructor for the fetching API course. However, I keep getting a "SyntaxError: missing ) after argument list"... but I followed the code exactly.

Here is a snapshot of my workspace: https://w.trhou.se/p4f93jj14e

Can anyone tell me what's wrong?

2 Answers

Error: Uncaught SyntaxError: missing ) after argument list around line 23 of app.js

If you look at line 24 you are using backticks instead of single quotes around ${item}

  const options = data.map(item => `
  <option value='${item}'>${item}</option>
  `);

See @ 5:26 in the video for reference

Jamela Peterson
Jamela Peterson
2,977 Points

Wow. Thank you so much KRIS NIKOLAISEN for catching this and your speedy response!! I was just about to call it a day. Now I can keep going and power through this course. You're the best!