context.lineJoin=joinStyle // miter (default), round, bevel
Sets the style used to connect adjoining line segments.
<!doctype html>
<html>
<head>
<style>
body{ background-color:white; }
#canvas{border:1px solid red; }
</style>
<script>
window.onload=(function(){
// canvas related variables
var canvas=document.getElementById("canvas");
var ctx=canvas.getContext("2d");
ctx.lineWidth=15;
// lineJoin: miter (default)
ctx.lineJoin='miter';
drawPolyline(50,30);
// lineJoin: round
ctx.lineJoin='round';
drawPolyline(50,80);
// lineJoin: bevel
ctx.lineJoin='bevel';
drawPolyline(50,130);
// utility to draw polyline
function drawPolyline(x,y){
ctx.beginPath();
ctx.moveTo(x,y);
ctx.lineTo(x+30,y+30);
ctx.lineTo(x+60,y);
ctx.lineTo(x+90,y+30);
ctx.stroke();
}
}); // end window.onload
</script>
</head>
<body>
<canvas id="canvas" width=300 height=200></canvas>
</body>
</html>