Fun with Masala – Object.create

I was playing around with Masala and Google Map’s API (that’s another article) when I stumbled upon a somewhat interesting use-case involving ES5’s Object.create function.

Getting Started

Using Masala together with Object.create we can create object factories that are able to be partially applied without resorting to constructor functions.

Continue reading

Is JavaScript call-by-value or call-by-reference?

A:  JavaScript is call-by-value.

Q:  How can that be when a majority of the types in JavaScript are implemented as references?

A:  Both call-by-value and call-by-reference (termed evaluation strategies), have absolutely nothing to do with how variables are represented or communicated within a language. Evaluation strategy instead defines the extent to which a function is able to manipulate the environment from which it was called through the arguments it has received.

Continue reading