DEV Community

loading...

Code of the day (Learning Typescript)

cizu64 profile image charles ・1 min read

Typescript is really cool, thanks to Microsoft. I just started learning hybrid app development and I am deliberating whether to use ReactNative or NativeScript. I think I would learn NativeScript faster as it has direct support for TypeScript and I have a long background on the .NET Framework.

Code of the day

TypeScript

function identity(arg: T): T {
return arg;
}

let gen = identity>(["Welcome to genrics in TypeScript",1,(2+2),"Hi"]);
console.log(gen);

Converted Javascript

function identity(arg) {
return arg;
}
var gen = identity(["welcome to genric", 1, (2 + 2), "Hi"]);
console.log(gen);

Your welcome to join me as we learn together.

Discussion (0)

pic
Editor guide