What's happening here?

Trying to realize Peter Shirley's famous book Ray Tracing in One Weekend in TypeScript and Web Assembly.