Edit in JSFiddle

var c = document.getElementsByTagName('canvas')[0].getContext("2d");

c.beginPath();
c.lineCap = 'round';
c.moveTo(20,20);
c.lineTo(200,380);
c.lineWidth = 15;
c.strokeStyle = 'blue';
c.stroke();
c.beginPath();
c.moveTo(380,20);
c.lineTo(200,380);
c.lineWidth = 15;
c.strokeStyle = 'blue';
c.stroke();
<canvas width="400" height="400"></canvas>