Javascript Array Concat not working. Why?

The concat method doesn’t change the original array, you need to reassign it.

if ( ref instanceof Array )
   this.refs = this.refs.concat( ref );
else
   this.refs.push( ref );

Leave a Comment