Show all feed information | Ping Blog Update
If you think Object.defineProperty() is not widely adopted, here the list of browsers that support it, together with Object.create() and Object.defineProperties() . Desktop Chrome 7+ Firefox 4+ Safari 5+ Opera 12+ IE 9+ Mobile Android 2.2+, 3+, and 4+, stock browser Android 4.1+ Chrome Android …
The proper title for this post could have easily been something like JavaScript Inheritance Demystified or slightly less boring as The Untold Story About JavaScript Objects ...well, thing is, I don't really want to alarm anyone about this story and as a randomly improvised storyteller, let's move …
I can't believe it, every time some cool pattern comes into games, __proto__ makes everything pointless, in a trusted meaning of a generic property! Previously, in Internet Explorer One of the biggest and most known WTFs in IE is the fact that Object.prototype properties are not enumerable. While …
I believe we all agree that Google Closure Compiler is one of the most advanced tool we have for JavaScript development: fast parsing with pretty printed or minified output with warnings about possible problems or errors type checks analysis before it was cool, as example via java -jar …
There are several UMD ways to define a module with zero dependencies but I believe that's quite an overhead so here an alternative: (this.define || function(){})( this.exportName = exportValue ); What Is `this` In node, this is always the exports object so this.name = value is not different from …
While examples used in this post are implemented in JavaScript, concepts discussed here about getters are, in my experience, universally valid. No matter if we are programming client or server, getters can be full of wins and if you think getters are a bad practice because of performance keep …
This (apparently non working) gist gave me the hint. Stuff I've been dealing with for a while , finally used to bring an Object.create(firstArgOnly) cross platform/engine/client/server code that works. The name? inherit() More Reliable Than Object.create() The reason I didn't even try to …
it seems to me the most obvious thing ever but I keep finding here and there these common anti pattern: // 1. The timer Case this.timer = setTimeout( this.doStuff.bind(this), 500 ); // 2. The Listener Case (objOrEl || this).addEventListener( type, this.method.bind(this), false ); What Is Wrong I …
Many times I read or write silly stuff and often it takes a while before I realize " what dafuq did I just read ? " Well, this post is about just few a-ha moments, together with WTF s, I keep having from time to time: enjoy! Those 4 Repeated + Disturbing Bytes I mean, this must come first, right? …
... this is after my latest post , just to summarize with a bit of humor my thoughts on developers getting easily excited with new stuff :D Once again, not everything is wrong with TypeScript, but this is how I have really felt as soon as I have heard about this yet another JS superset and after …