Checkio exercises solving in Javascrip