I'm not sure if I'm calling it the right thing, but I'm trying to dynamically create a bunch of key => value pairs in a javascript object.

Something like this:
Code JavaScript:
var pets = {};
 
for( var i=1; i<=4; i++ ){
	pets = $.extend( pets, {
		'pet-type-' + i:		$('#pet-type-' + i).val(),
		'pet-breed-' + i:		$('#pet-breed-' + i).val(),
		'pet-age-' + i:		$('#pet-age-' + i).val(),
		'pet-weight-' + i:	$('#pet-weight-' + i).val(),
		'pet-comments-' + i:	$('#pet-comments-' + i).val()
	});
}

or this:

Code JavaScript:
var people = {};
 
for( var i=1; i<=10; i++ ){
	people = $.extend( people, {
		i + '-first-name':		$('#first-name-' + i).val(),
		i + '-last-name':			$('#last-name-' + i).val(),
		i + '-dob':				$('#date-of-birth-' + i).val()
	});
}

But the console gives me errors, and I haven't been able to find a way to do this. I've tryed putting the keys in square brackets, as was suggested somewhere online, but that didn't work.