-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path37.ts
17 lines (11 loc) · 787 Bytes
/
37.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//3Large Shirts: Modify the make_shirt() function so that shirts are large by default with a message that reads I love TypeScript. Make a large shirt and a medium shirt with the default message, and a shirt of any size with a different message.7.
function makeShirt(size: string = "Large", message: string = "I love TypeScript"): void
{
return console.log(`Size: ${size}, Messgae: ${message}`);
}
// Large shirt with default message
makeShirt(); // Output : Size: Large, Message: 'I love TypeScript'
// Medium shirt with default message
makeShirt("Medim"); // Output : Size: Medium, Message: 'I love TypeScript'
// Custom shirt with a different meessage and size
makeShirt("Small", "Hello TypeScript!"); // Output : Size: Small, Message: 'Hello TypeScript!'