answer for js question 1,2,3,4