(upbeat music)
- [Instructor] Ready to try your hand at working with JSON.
It's time for a challenge.
My start code is a JSON file.
And at first glance into my editor, it's clear,
the code has some challenges.
The squiggly underlines all indicate places where the editor
suspects my code is written incorrectly.
Your task is to fix the errors in this code.
There's an issue on each line.
And although the editor may give you some help,
when you hover the mouse pointer over an error,
it's not always going to be specific enough to explain what
you need to do to fix it.
There's an issue on each line.
So use this list of basic JSON syntax rules,
along with the editor highlighting to figure out
what might help,
then try it out.
Remember that in debugging fixing one error may change how
others are identified for this JSON snippet.
Try starting on the first line and working your way down.
This ensures you're not trying to fix something that's being
affected by an error earlier in the code.
For instance, I see the word item flagged
in the first key value pair.
When I hover over it, I get a pretty helpful message.
Property keys must be double quoted.
I've got single quotes here,
so I'll change those to double quotes.
And now the arrow goes away.
One down.
If you want an extra challenge,
add an additional key value pair to this structure
with an array as its value.
For instance,
you could create a key called list price history,
and store a few numerical prices in an array as its value.
This exercise should take you about 10 minutes.
When you're done,
join me in the next video
and I'll walk you through how I approached it.