javascript resolutions for codility.com train exercices