JavaScript loops-arrays-strings and DOM homeworks