javascript canvas 1px line

JavaScript
ctx.moveTo(50,150.5);
ctx.lineTo(150,150.5);
Source

Also in JavaScript: