Im currently using jQuery to build an Array
like this:
var arr = new Array();
$('#some-form .some-input').each(function() {
arr.push($(this).val());
});
which builds something like:
arr[0] = 'bar'
arr[1] = 'foo'
Now I want a data structure (a 'map'? a JSON array?) to do get something like this:
{ 'key1' : 'foo'
'key2' : 'bar' }
because I am now going to store multiple 'things' from $('#some-form .some-input')
.
In C
, I think this could be a linked list because you don't know how big the data structure will be in advance so you wouldn't use an array. However, I AM using an array here which might not be the best idea? What's sort of structure do I need?
Many thanks.