Your sample data as well as the provided list of country codes are valid JavaScript, but they are not JSON. To make them valid JSON, put all strings in double quotes:
[
{"name": "Afghanistan", "code": "AF"},
{"name": "Albania", "code": "AL"}
]
This answer on StackOverflow gives a nice overview of the differences between JavaScript and JSON.
Regarding your initial question, your sample data would look like this:
[
{"product1": "price1"},
{"product2": "price2"},
{"product3": "price3"},
{"product4": "price4"}
]
In most cases1 it's probably better to make your prices actual numbers instead of strings that just look like numbers:
[
{"product1": 123.45},
{"product2": 234.56},
{"product3": 345.67},
{"product4": 456.78}
]
If you think about adding more properties to your products in the future, you should probably use this instead:
[
{
"name": "product1",
"price": 123.45
},
{
"name": "product2",
"price": 234.56
},
{
"name": "product3",
"price": 345.67
},
{
"name": "product4",
"price": 456.78
}
]
1 As Walter Tross pointed out in the comments, there are edge cases when rounding errors can occur. For example, if you have a product that costs 456789.99, it might happen that the computer program that reads your JSON will actually calculate the price as 456790.00. There is currently no simple solution for this problem. If you think this might be relevant for you, you might want to read up on some related discussions and the general problem of the precision of floating point numbers.