vendredi 27 octobre 2017
Typescript
Par Nicolas, vendredi 27 octobre 2017 à 23:59 :: geek stuff
Const - block scoped - better than var which has a global scope
Types - boolean, number, string, symbol, null, undefined
type inference : const tax = 20;
interface Puppy {
name: string; age: number;
};
const realPuppy: Puppy = {
name: 'Pikachu', age: 1
};
Parameterized types
const betterCats: Array<Cat> = [
{name: 'Simba', age: 22}, {name: 'Aslan', age: 9999}
];
classes and inheritance export class = pubilc
Filter is an Array method that allows you to generate a new array keeping only the truthy values that are provided from the returning callback
numbers.filter(number => number > 30)
Enums Async / Await Getters / Setters Destructuring Arrow functions