Function assign

  • Type Parameters

    • A
    • B
    • C
    • D
    • E
    • F
    • G
    • H

    Parameters

    • a: A
    • Optionalb: B
    • Optionalc: C
    • Optionald: D
    • Optionale: E
    • Optionalf: F
    • Optionalg: G
    • Optionalh: H

    Returns A & B & C & D & E & F & G & H

    Wrapper over Object.assign to merge multiple objects with proper typing.

    const ra = {
    name: 'Ra',
    power: 100
    }

    assign(ra, { name: 'Loki' })
    // => { name: Loki, power: 100 }