typescript generic inline type code example
Example 1: generic arrow function typescript
const foo = <T extends unknown>(x: T) => x;
Example 2: how to make a generic variable in javascript
var x = 1;
var y = 1;
if (x == y) {
x = x + 1
}
const foo = <T extends unknown>(x: T) => x;
var x = 1;
var y = 1;
if (x == y) {
x = x + 1
}