Drawing from nearly 15 years of coding visual effects, the bag of tricks is heavy. In programming terms it’s called an abstract object.An abstract object allows us to have one object that defines all the variables and functions that we need to use it, then give those same variables and functions to all objects that inherit from it so that we don’t have to duplicate any code. JavaScript Beginner Tutorial. HTML5 has made a huge contribution to the gorgeous websites being designed everyday. Array Cardio Day 1. Here you will find the best tutorials and resources to learn Canvas and other HTML5 aspects. Fun with HTML5 Canvas. Strings! As a result, one has to write the correct code like this. Create the canvas element — give it an id, and a width/height (HTML) Add base styles — center the canvas, add a background color, etc (CSS) In JavaScript, get your canvas element by using the id; Use the canvas element to get the context (your toolbox; more on it later)