Created
July 20, 2019 21:08
-
-
Save mlevkovsky/845f572f7af6b6f71f78e16b124cdb89 to your computer and use it in GitHub Desktop.
magic strings
This file contains 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
public getName(): string { | |
let result = "NO NAME FOUND"; | |
if(this.name) { | |
result = this.name; | |
} | |
return result; | |
} |
This file contains 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
export class User { | |
private readonly NAME_DEFAULT = "NO NAME FOUND"; | |
private name; | |
public getName(): string { | |
let result = this.NAME_DEFAULT; | |
if(this.name) { | |
result = this.name; | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment