Why do all canvas examples use ctx?

canvas, html, javascript

Solution

It is a shorthand for the word "context". That's it.

Of course you can use whatever name you like - there is no real naming convention in this instance.

Problem

Is this a requirement or a convention? If it's a convention what's the reason? Ctx doesn't seem especially memorable or intuitive. e.g. ``` var ctx = document.getElementById('canvas').getContext('2d'); ```

Original source