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
$(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"
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.
var test = (""+arr).split("");
.size()doesn't return an array, it returns a number. I don't understand what you're doing with that.