Ive had a hard time adjusting to arrow functions for some reason. If you remember input => output, that should make it click for you. Just remember: Why dont you check out .map .filter and .foreach next?
Define Global Variables and Functions in Typescript
Global variables are considered bad practice. In Typescript all variables are namespaced and isolated within the modules they are defined in. However sometimes you just need a global variable. This is how you do it: (<any>window).yourVariable = 0; (<any>window).yourFunction = function () { alert() };