0

I want to do some localization by externalizing string and having some strings use other parts of the text object below. But I find that I can't refer to the object that it is part of. Is there is a way around this?

var text = {greeting: "hi", fullGreeting: text.greeting + " sir"}
akantoword
  • 2,824
  • 8
  • 26
  • 43
  • I am so confused with what you're asking that I've flagged your question as **unclear what you're asking**. Please elaborate on exactly what you're after. – gotnull Jul 26 '16 at 00:36
  • the duplicate was helpful, thank you. but I don't understand the top answer of why it has to include "return this". isn't that init function just adding a key/value pair to the object? that's it's whole purpose, why does it have to return anything? – akantoword Jul 26 '16 at 00:57

0 Answers0