Write the following code in the right window in the console tab:
Code: Select all
var myObj = new Object;
myObj['myProperty'] = 454;
myObj = true;
myObj[true] = 'hello';
var myDate = new Date;
myDate['a'] = 'You can use any type of object as a hash';
location['bingo'] = 'Yes, I mean _any_object';
and click run.
Your output in the left window should be:
Yes, I mean _any_object
In this way, you can get a flying start in object oriented programming if you learn to look at code and use FireBug efficiently.
For more information see:
http://www.webproworld.com/web-programm ... post226176
There are some examples here:
Some of them do not function for obvious reasons. Some are in PHP where you are not able to see the code. The jQuery examples http://www.kjellbleivik.com/Books/jquery/content.htm should be fairly accurate though.