Line drawing uses paths in the canvas:
How to draw a line in javascript canvas. Use the stroke () or fill () method to draw the path. The methods the beginpath () method starts a new path. It does not draw anything, it just sets a start point.
Web draw a line your browser does not support the canvas element example Web description the lineto () method adds a line from the last point in the path to a new point.