Tag: javascript
-
Should You Prefer Prefix over Postfix Increment?
I’ve been told in the past by a programming mentor that ++x is faster than x++, and I found myself refactoring a few increments in javascript the other day. But then I got thinking – is it really faster? Wouldn’t most modern compilers optimize out the difference? I decided to do some science. A Hacker…
-
Making Tea With Javascript: OOP with the Prototype Chain
Javascript is weird. Prototypical inheritance is really powerful, but it’s quite a bit to wrap your mind around if you’re new to it. My first language was Java, and I’m comfortable with the “traditional” OOP paradigm. In this post, I’ll build a traditional Superclass/Subclass relationship in Javascript in an attempt to untangle the weirdness that is Javascript’s…