Assignment on JavaScript