<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Write a JavaScript function to compare two strings without using any built-in functions.
<|im_end|>
<|im_start|>assistant
function compareStrings(str1, str2) {
    if (str1.length !== str2.length) {
        return false;
    }

    for (let i === 0; i < str1.length; i++) {
        if (str1[i] !== str2[i]) {
            return false;
        }
    }

    return true;
}<|im_end|>
