Bijective function (one-to-one correspondence) function in layman's terms with TypeScript generic notation:
function bijective<input, output>(arg1: input, arg2: output): void /* <= instead of "return;" do "void" */ {
console.log(`${arg1}=>${arg2}`);
/* return; */
}
bijective<number,boolean>(0, false) // # "0=>false"
bijective<number,boolean>(1, true) // # "1=>true"
Top comments (0)