What’s the difference between “{}” and “[]” while declaring a JavaScript array?

Nobody seems to be explaining the difference between an array and an object. [] is declaring an array. {} is declaring an object. An array has all the features of an object with additional features (you can think of an array like a sub-class of an object) where additional methods and capabilities are added in … Read more

How can I generate a rainbow circle using HTML5 canvas?

This is not perfect (due to drawing steps …), but it can help you : http://jsfiddle.net/afkLY/2/ HTML: Javascript: The idea is to draw the disc line by line with a hue value corresponding to the line direction. You can change the color base rotation by adding a radius angle to rad variable (adding -pi/2 to rad would make the … Read more