javascript practice using passing value and reference