Function zip

  • Combine keys with corresponding items in values to form and return an object. values could be undefined may not have items corresponding to some keys but all keys must be provided.

    Parameters

    • keys: IKey[]
    • Optional values: any[]

    Returns {}

      Example

      import { zip } from 'apption'
      const obj = zip(['a', 'b', 'c'], [1, 2, 3]);
      console.log(obj) // { a: 1, b: 2, c: 3 }