JavaScript homework