In my code, there is an ES6 class called User
and a global function named map()
:
class User {
constructor(public name: string) {}
}
const map = <T, R>(project: (value: T) => R) => {}
Instead of the usual way of calling map like this:
map((value) => new User(value))
I am curious if it's possible to do something like this:
map(new User)
I am unsure whether this approach is feasible. Any thoughts?