sample code for javascript programming