Something to note about the JS examples, if you throw them into TypeScript you'll get similar error messages to go vet and rustc.
The first example: https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABMO...
Unreachable code detected
Along with some typos since `i` isn't declared.