The is a demo of ArcGIS JavaScript API. This sample shows how you can use a draw toolbar to sketch many kinds of geometries on the map.
Draw : Point Multipoint Line Polyline Polygon Freehand Polyline Freehand Polygon Deactivate