Store different numbers into an array <p>Lets say you have a situation where you get 3 numbers from different sources, I wanna merge them together in 1 array and came up with this. Its almost do the trick but I can't combine the numbers into 1 array</p> <pre><code>$(n + " " + 'ul').each(function(){ var arr = ( $(this).children('li').size()); var test = (""+arr).split(""); console.log(test) }); //Outcome in console "1" "2" "3" //Outcome in console what I need "1, 2, 3" </code></pre> <p>Something about this line isn't right, I know the split doesn't work but I can't come up with something better to achieve the result.</p> <pre><code>var test = (""+arr).split(""); </code></pre>