def arr_to_js_str(arr, converter):
    """Convert a python array to a string represent Javascript array"""

    result = str([converter(i) for i in arr])
    if converter is bool:
        return result.replace('T', 't').replace('F', 'f')
    return result