getContext is not a function

Your value: is a jQuery object, not a pure Canvas element. To turn it back so you can call getContext(), call this.element.get(0), or better yet store the real element and not the jQuery object: See running code at http://jsfiddle.net/alnitak/zbaMh/, ideally using the Chrome Javascript Console so you can see the resulting object in the debug … Read more

One liner to flatten nested object

Here you go: Summary: recursively create an array of one-property objects, then combine them all with Object.assign. This uses ES6 features including Object.assign or the spread operator, but it should be easy enough to rewrite not to require them. For those who don’t care about the one-line craziness and would prefer to be able to … Read more