. notaion vs. [] notation | Inserting into a Text Object
<p>I kind of move between dot notation and bracket notation on the line of code noted below.  <code>JavaScript - The Good Parts</code> suggests using dot notation by default.</p>

<p>How can I update this code to use the dot notation.  Note that form_elements contains form input names as keys which are valid JavaScript identifiers ( they use alphanumeric characters only ).</p>

<p>According to <code>JavaScript - The Good Parts</code> this means they can be used with the dot notation.</p>

<pre><code>Su.text = function (form_elements) {
    this.text_object = {};
    var key;
    for (key in form_elements) { //*u
        if (form_elements.hasOwnProperty(key)) {
            this.text_object[form_elements[key].name] = form_elements[key].value; // this line
        }
    }
    return this;
};
</code></pre>
