Upon researching on a way to transfer a set of data, I read that you should use JavaScript Objects instead of Arrays. However, I can't get the following example to work. Can someone help shed some light on what I'm doing wrong?

HTML Code:
<script language="javascript">

var products = new Object();

var products[1] = new Object();
products[1]['name'] = "Tv";
products[1]['price'] = "$500.00";

var products[2] = new Object();
products[2]['name'] = "DVD Player";
products[2]['price'] = "$130.00";


alert(products[2]['price']);

</script>