Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface FullName {
- firstName?: string,
- lastName?: string
- }
- function sayName(params: FullName = {}) {
- const { firstName = 'Andrew', lastName = 'Smith' } = params;
- const name = firstName + ' ' + lastName;
- console.log(name);
- }
- sayName();
- sayName({ });
- sayName({ firstName: 'Shaun' });
- sayName({ firstName: 'Shaun', lastName: 'Greene' });
Advertisement
Add Comment
Please, Sign In to add comment