javascript learning -test of basic function