why not use a local variable, instead of changing the global state of this.labels? You can return the local variable, instead of changing it over and over again.