Created
July 9, 2018 14:21
-
-
Save JaykeOps/aa33b3630614ca3e1ca73ac06b34839e to your computer and use it in GitHub Desktop.
Twitten Example 1
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 createUser(uname: string, pw: string): User { | |
if (!(uname && pw)) | |
throw new Error("Validation failed!"); | |
return { username: uname, password: pw }; | |
} | |
try { | |
createUser("John Doe", "hello123"); | |
} catch (error) { | |
throw error; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment