This blog talks about some tips and techniques while writing typescript code.

Function Declarations:

Example 1: Arguments with type:

function greet(person: string, date: Date) {console.log(`Hello ${person}, today is ${date.toDateString()}!`);}

Example 2: Return type:

function randomNumber(): number {return 26;}
// says that randomNumber will return a number

Example 3: Argument with an Object type:

function printCoord(pt: { x: number; y: number }) {console.log("The coordinate's…

Till Engineering

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store