Problem Solving In Javascript for beginners!