It is how Javascript has always worked... Arrays and Objects are by reference, so in this situation, you have to return a new instance to get that separation.
In other libraries this was usually handled in the constructor with this.varname = []; but in Polymer, if you want to handle it in the properties definition (recommended way) requires the function call. -Karl Tiedt On Fri, Mar 18, 2016 at 9:00 AM, Rob Stone <[email protected]> wrote: > Thinking about the mechanics of this, I can now see why it works this way. > However, it is still a pretty nasty gotcha and it might be worth looking at > that area of the documentation and making this issue a bit more obvious. > > Follow Polymer on Google+: plus.google.com/107187849809354688692 > --- > You received this message because you are subscribed to the Google Groups > "Polymer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/polymer-dev/08b6ea93-1fde-4d29-8271-71b5cf859343%40googlegroups.com > <https://groups.google.com/d/msgid/polymer-dev/08b6ea93-1fde-4d29-8271-71b5cf859343%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CADNgbTHP0vacjfGFo9chEp5xcq4-SGuBTUkve94_BR2Nu_FSMA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
