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.moveTo(10,10);
ctx.lineTo(10,100);
ctx.lineTo(200,100);
ctx.closePath();
ctx.stroke();
</script>