I have a generic function like this :
export function f<T >(json: Object): T {
return new T()
}
but I got this error when com'T' only refers to a type, but is being used as a value here.
how should i handle this ?
I have a generic function like this :
export function f<T >(json: Object): T {
return new T()
}
but I got this error when com'T' only refers to a type, but is being used as a value here.
how should i handle this ?