cachaito
5/18/2015 - 9:07 AM

Convert plain value to array

var value = 'Mirek';

//lame 
if(!Array.isArray(value)) {
  value = [value];
}

//nice
value = [].concat(value);

//nicer
Array.prototype.concat.call([], value);