Help Why Does This Code Throw A Typescript Error Typescript

Help Why Does This Code Throw A Typescript Error Typescript