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
| // Le typage TypeScript ne se base pas sur les interfaces mais sur les "Shapes" inspirées du "Duck Typing" Python. | |
| // "If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck." | |
| // If we don't have access to external classes | |
| class User { | |
| firstName: string; | |
| lastName: string; | |
| email: string; | |
| } |
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
| // this | |
| // JS Function : Without using the "strict" mode, this refers to the context in which someFunction() was called | |
| // In "strict" mode, this would be undefined, which is slightly less confusing. | |
| // http://jsbin.com/vekawimihe/2/edit?js,console | |
| // When this is used inside an arrow function JavaScript uses the this from the outer scope | |
| // class | |
| class Hamburger { | |
| constructor() { | |
| // This is the constructor. |
NewerOlder