function getSchool(name: string, address?: string, pinCode?: string): string { if (address == undefined) { console.log('address not defined'); } if (pinCode == undefined) { console.log('pincode not defined'); } //... }
References
http://dotnetpattern.com/typescript-optional-parameters