Welcome to the Linux Foundation Forum!

Error in example code: Mocking a Web Service (2)

Posts: 1
edited March 9 in LFW111 Class Forum

In the Mocking a Web Service (2) section, there’s an error in the example code:

  1. const data = [
  2. {id: 'A1', name: 'Vacuum Cleaner', rrp: '99.99', info: 'The most powerful vacuum in the world.'},
  3. {id: 'A2', name: 'Leaf Blower', rrp: '303.33', info: 'This product will blow your socks off.'},
  4. {id: 'B1', name: 'Chocolate Bar', rrp: '22.40', info: 'Deliciously overpriced chocolate.'}
  5. {id: 'B1', name: 'Chocolate Bar', rrp: '22.40', info: 'Deliciously overpriced chocolate.'}
  6. ]

Besides the third object being repeated, there is no comma after it (probably because the repetition is a mistake), which is causing a syntax error.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training