1<script type="text/javascript">
2var myObj = {
3 fred: { apples: 2, oranges: 4, bananas: 7, melons: 0 },
4 mary: { apples: 0, oranges: 10, bananas: 0, melons: 0 },
5 sarah: { apples: 0, oranges: 0, bananas: 0, melons: 5 }
6}
7
8document.write( myObject[ 'fred' ][ 'apples' ] );