programming languages - Do common JavaScript implementations use string interning? -


do common javascript engines, such v8 , webkit's javascriptcore, use string interning javascript strings? or keep multiple instances of identical strings in memory?

yes. in general literal string, identifier, or other constant string in js source interned. implementation details (exactly interned instance) varies, when interning occurs.

note string value not same string object though, string objects not interned because fundamentally incorrect behaviour.


Comments