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