Answers for "Array<Type> VS Type[] in Typescript"

0

Array<Type> VS Type[] in Typescript

function loggingIdentity<T>(arg: T[]): T[] {
    console.log(arg.length);
    return arg;
}
// or 
function loggingIdentity<T>(arg: Array<T>): Array<T> {
    console.log(arg.length);
    return arg;
}
Posted by: Guest on July-24-2021

Code answers related to "Array<Type> VS Type[] in Typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language