Skip to content

TypeScript ​

TS-7. Build an array with map, filter, find, some or reduce, not with a loop that fills an outer variable; use a loop for side effects. ​

TS-8. Pass a function itself to an array method only when it is your own function of one parameter; wrap a built-in or a function with an optional parameter in an arrow. ​

TS-9. Type as readonly every module-level constant array or object and every array or object parameter a function only reads. ​

TS-10. Write a class only for instance state together with the methods that change it. ​