Drawing Lines

I’m new to OpenStreetMap and wonder if there is an easy way for drawing polylines on maps using javascript API

Thank you

You can use the openlayers examples for that. It uses JavaScript.

Yet easier: use GpxToSlippyMap

GpxToSlippyMap: show your .gpx and .fit tracks on an open street map