JavaScript Displaying the Content

Jamela Peterson
Jamela Peterson
Full Stack JavaScript Techdegree Student 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
Full Stack JavaScript Techdegree Student 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!