Skip to content

Instantly share code, notes, and snippets.

View arthurbarros's full-sized avatar
🏠
Working from home

Arthur Barros arthurbarros

🏠
Working from home
View GitHub Profile
@arthurbarros
arthurbarros / gist:5266720
Last active December 15, 2015 13:19
[solved] javascript: strange behavior // The problem that was that concat() dosen't change the value of the array, it returns the two arrays joined
function Foo(){
this.baz = [];
this.set = function(bar){
this.baz = this.baz.join(bar);
return this;
}
}
foo = new Foo();
foo.set({'a':123}).set({'b':321});