Javascript homeworks 1-4