Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Displaying the Content

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

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!