Guest User

Untitled

a guest
Jul 9th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. function createUser(uname: string, pw: string): User {
  2. if (!(uname && pw))
  3. throw new Error("Validation failed!");
  4. return { username: uname, password: pw };
  5. }
  6.  
  7. try {
  8. createUser("John Doe", "hello123");
  9. } catch (error) {
  10. throw error;
  11. }
Add Comment
Please, Sign In to add comment