• Just like array.map

    Example

    map('Hello', (char) => char == 'o' ? 'O' : char); // 'HellO'
    

    Parameters

    • str: string
    • fn: ((char: string, index: number, chars: string[]) => string)
        • (char: string, index: number, chars: string[]): string
        • Parameters

          • char: string
          • index: number
          • chars: string[]

          Returns string

    Returns string

Generated using TypeDoc