This code is just... wrong. On multiple levels. It's probably not doing what its author thinks it does. It also contains significant duplication where its entirely unnecessary.
Suffice it to say that you should probably not judge languages based on examples written by people who don't understand the language.