Welcome to the Linux Foundation Forum!

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

ekathuria
ekathuria 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:

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

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.

Categories

Upcoming Training