Beginners guide to javascript