Check_string_endings_JS Check if a string (first argument, str) ends with the given target string (second argument, target).