prob 2, JavaScript