what would be the advantage of doing this? I've been doubting between both approaches in other PRs but I'd like to understand the reasoning. TIA

Sent from my iPhone

On May 16, 2013, at 9:52 PM, Tom Payne <notifications@github.com> wrote:

> In src/ol/parser/wkt.js:
> 
> > +    }
> > +  }
> > +  return geometry;
> > +};
> > +
> > +
> > +/**
> > + * Encode a geometry as WKT.
> > + * @param {ol.geom.Geometry} geom The geometry to encode.
> > + * @return {string} WKT string for the geometry.
> > + * @private
> > + */
> > +ol.parser.WKT.prototype.encode_ = function(geom) {
> > +  var type = geom.getType();
> > +  var result = type.toUpperCase() + '(';
> > +  switch (type) {
> Can you use instanceof here instead of calling getType() and then switching on the returned string?
> 
> —
> Reply to this email directly or view it on GitHub.