That is to make this:
[ [\'dog\',\'cat\', [\'chicken\', \'bear\'] ],[\'mouse\',\'horse\'] ]
into:
[\'dog\',\'cat\',\'chicken\',\'
Small fix for ChewOnThis_Trident solution and it works perfect:
Array.prototype.flatten = function() { return this.reduce(function(a, b) { return a.concat(b); }, []); };