Created
April 7, 2024 15:33
-
-
Save amberlex78/f03753fbd168b6496a55bffd88ca21e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function greet(person: string, date: Date): void { | |
console.log(`Hello, ${person}! Today is ${date.toDateString()}.`); | |
} | |
const getFullName = (first: string, last?: string): string => | |
last ? `${first} ${last}` : `${first}`; | |
let fullName = getFullName("John"); | |
greet(fullName, new Date()); | |
fullName = getFullName("John", "Doe"); | |
greet(fullName, new Date()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment