Does String Contains Substring

This javascript function returns true if the substring is contained within the string. If not it returns false.

function contains(haystack, needle)  {
    if (haystack=="" || needle=="")  { return false; }
    haystack = haystack.toUpperCase();
    needle = needle.toUpperCase();
    return ​haystack.indexOf(needle) !== -1;
}

Example:

string = "Hello world.";
substring = "world";

if (contains(string, substring )) {
    console.log("TRUE");
} else {
    console.log("FALSE");
}

The console displays: TRUE