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
// Amount of time to run the problem | |
const RUN_TIMES = 10000 | |
const runProblem = (change) => { | |
// Starts with 3 doors containing nothing | |
const chances = ['nothing', 'nothing', 'nothing'] | |
// Puts money behind one of the three doors randomly | |
chances[Math.floor(Math.random() * 3)] = 'money' | |
// Picks one of the doors randomly |
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
class Person { | |
private name: string; | |
private age: number; | |
constructor(name: string, age: number){ | |
this.name = name; | |
this.age = age; | |
} | |
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
class Person { | |
constructor(name, age){ | |
this.name = name; | |
this.age = age; | |
} | |
advanceAge(){ | |
this.age++; | |
} |
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
(<any>ExternalModule).method() // ALWAYS avoid this |
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
User.fetchAll<User>() | |
.then((result) => { | |
}); |
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
class Server { | |
public app: express.Application; | |
public config: Config; | |
public static bootstrap(): Server { | |
return new Server(); | |
} | |
constructor() { | |
this.app = express(); | |
this.setup(); | |
this.routes(); |