Which built-in method returns the calling string value converted to lower case?

This what I have so far, but I am getting a "Uncaught TypeError: Cannot read property '0' of undefined" error and I can't seem to figure it out.

function second_function(str)
                        {
                            var i;

                            for (i = 0; i < arguments.length; i++)
                            {
                                if(str.codeCharAt[i] >= 65 || str.codeCharAt[i] <= 90)
                                {
                                    str.codeCharAt[i] += 32;
                                }
                            }
                            return str;
                        }

i = 0 should equal to the first letter. If anyone could help it would be greatly appreciated. Also I have very little to no skills in JavaScript so please bear with me.

Javascript javascript, lower 0 Answer