Skip to content

Comment on Andro.jsparent

Comments

I'm not convinced this is useful JavaScript optimization advice. JavaScript doesn't have integers, and string literals are interned, so it shouldn't make a substantial difference if you have the same literal written out 15 times or just defined once and placed in a property. (In fact, using the plain literal everywhere may be faster because it omits the dynamic property access.)

I'd rather mistype an identifier than a string literal, because nothing will complain about the wrong string literal.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.