I am having the next function in typescript:
In c# you have something like default(T) but in typescript I dont know.
public Base {
...
}
public Get<T extends Base>(cultura: string): T[]
{
let res = null;
try
{
}
catch (ex)
{
throw ex;
}
return res;
}
I want to return a null but I get an error. If I assign it in a variable the null and return the variable happens the same error.
Message is: The 'null' type can not be assigned to the type T[].
The error is:
How can I do it in TypeScript?
