JavaScript exercise solutions