I am interested in creating a JSON array where I can define the fields and add data to it later in my code. However, I am unsure about the correct syntax to achieve this. So far, my attempts have resulted in some parse errors;
<script>
var myJSONArray = [
{item: , cost: , quantity: }; // Setting up the array for future population
]
and then at a later stage ....
myJSONArray.push(milk,1.99,2); // Adding different items into the array fields