javascript exercise mathematics