Checking whether or not two strings are identical in size and hold identical values
<pre><code>string1 = prompt("String 1?");
string2 = prompt("String 2?");

if (string1.length == string2.length)
    alert (string1 + " and " + string2 + " : are identical in size.") 
        else
    alert (string1 + " and " + string2 + " : not identical in size.") 

for(i=0; i&lt;string1.length; i++)
    {
        for(j=0; j&lt;string2.length; j++)
        {
        if (string1.charAt[i] == string2.charAt[i])
            alert (string1.charAt[i] + " and " + string2.charAt[j] + " : are identical values.")
                else
            alert (string1.charAt[i] + " and " + string2.charAt[j] + " : are non-identical values.")
        }
    };
</code></pre>

<p>The second part of the code keeps returning "undefined" and "undefined". I'm trying to compare both strings to see if they hold identical values. Would appreciate any help!</p>
