please help me to solve this minimal javascript code problem
<p>My inputs are: an array of object names and objects. I want to loop through the array for object name and then output something from corresponding object. My code is as follows:</p>

<pre><code>    options=["bold","italic"] ;

    var bold ={
            action: function(){
                alert("&lt;strong&gt;just bold&lt;/strong&gt;");
            },
            b_p: "-40px bold"
     };

    var italic ={
            action: function(){
                alert("&lt;em&gt;an italic&lt;/em&gt;");
            },
            b_p: "-20px italic"
     };

     for(i=0;i&lt;options.length;++i)
     {
         document.write(options[i].b_p);
     }
</code></pre>

<p>My desired output: "-40px bold -20px italic" but I get an error saying: "undefined undefined".</p>

<p>Please help me to find out my mistake/ignorance here.</p>

<p>Thanks.</p>

<p>/<strong><em>*</em>**<em>*</em>**</strong>/
Update: the problem is solved below :-) Thanks communtiy</p>
