loading...

Code of the day (Learning Typescript)

twitter logo github logo ・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.

twitter logo DISCUSS
Classic DEV Post from Jan 24

What was your win this week?

Got to all your meetings on time? Started a new project? Fixed a tricky bug?

charles profile image
I do things!