When I call:
var result = inputs.map(function(){ return $(this).val(); });
result
contains an array like:
['foo', 'bar', 'buz']
I want to join result:
result.join(', ');
works, but
var result = inputs.map(function(){ return $(this).val(); }).join(', ');
gives
TypeError: undefined is not a function
My question is rather theoretically - why cannot I access result array in a chain and I have to assign it to the variable before working on the result ?