The moveto () defines the starting point of the line.
How to draw a line in javascript canvas. Use the stroke () or fill () method to draw the path. Web description the lineto () method adds a line from the last point in the path to a new point. It does not draw anything, it just sets a start point.
The lineto () method defines the end point of the line. Line drawing uses paths in the canvas: