TypeScript
Generic parameter defaults: any[] = []
Consider a function that creates a new HTMLElement, calling it with no arguments generates a Div; you can optionally pass a list of children as well. Previously you would have to define it as:
declare function create(): Container<HTMLDivElement, HTMLDivElement[]>;declare function create<T extends HTMLElement>(element: T): Container<T, T[]>;declare function create<T extends HTMLElement, U extends HTMLElement>(element: T,children: U[]): Container<T, U[]>;
With generic parameter defaults we can reduce it to:
declare function create<T extends HTMLElement = HTMLDivElement, U = T[]>(element?: T,children?: U): Container<T, U>;
Git
global ignore
git config —global core.excludesfile ~/.gitignore_global
echo .DS_Store >> ~/.gitignore_global
