Skip to content

zipToObject

Creates an object mapping the specified keys to their corresponding values.

Usage

zipToObject(["a", "b"], [1, 2]); // { a: 1, b: 2 }
zipToObject(["a", "b"], (k, i) => k + i); // { a: 'a0', b: 'b1' }
zipToObject(["a", "b"], 1); // { a: 1, b: 1 }

Installation

Terminal window
npx atmx add helper zip-to-object