Using map:
var values = $("input[id='task']")
.map(function(){return $(this).val();}).get();
If you change or remove the id (which should be unique), you may also use the selector $("input[name="task\\[\\]"]")
Working example: http://jsbin.com/ixeze3