The canvas beginPath() method is used to start a path or reset the current path. The moveTo(), lineTo(), quadricCurveTo(), bezierCurveTo(), arcTo(), and arc() methods are used to create paths. Also, the stroke() method is used to draw the path on the canvas.
Syntax:
context.beginPath();
Example 1:
Output:
👁 Image
Example 2:
👁 Image
Supported Browsers: The browsers supported by HTML canvas beginPath() method are listed below:
- Google Chrome
- Internet Explorer 9.0
- Firefox
- Safari
- Opera