Properly use foreach loop in TypeScript
Handle parsing a block