HTML 캔버스 beginPath(), closePath()

by JM note

HTML

<canvas id='myCanvas' width='250', height='150'></canvas>
<script>
var ctx = document.getElementById('myCanvas').getContext('2d');
ctx.beginPath();
ctx.lineWidth='3';
ctx.strokeStyle='red';
ctx.moveTo(10,10);
ctx.lineTo(200,100);
ctx.stroke();
</script>