Open this example in the interactive library
Source code
const words = ["build", "ship", "test"];
console.log(
(<A extends object, B extends object>(a: A, b: B) => ({ ...a, ...b }))(
{ name: "api" },
{ port: 3000 },
),
);
Sample output
{ name: 'api', port: 3000 }